Accepting request 197487 from home:fcrozat:branches:Kernel:kdump
- Add kdump.service to properly handle kdump initscript with systemd. OBS-URL: https://build.opensuse.org/request/show/197487 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=46
This commit is contained in:
parent
dbb4fded67
commit
9346aee607
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 4 14:50:58 UTC 2013 - fcrozat@suse.com
|
||||
|
||||
- Add kdump.service to properly handle kdump initscript with
|
||||
systemd.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 2 16:05:51 UTC 2013 - ptesarik@suse.cz
|
||||
|
||||
|
12
kdump.service
Normal file
12
kdump.service
Normal file
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Load kdump kernel on startup
|
||||
After=local-fs.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/etc/init.d/boot.kdump start
|
||||
ExecStop=/etc/init.d/boot.kdump stop
|
||||
RemainAfterExit=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
29
kdump.spec
29
kdump.spec
@ -40,9 +40,13 @@ BuildRequires: zlib-devel
|
||||
%if %suse_version > 1100
|
||||
BuildRequires: libssh2-devel
|
||||
%endif
|
||||
%if %suse_version > 1220
|
||||
BuildRequires: systemd
|
||||
%endif
|
||||
PreReq: %insserv_prereq %fillup_prereq mkinitrd
|
||||
Source: %{name}-%{version}.tar.bz2
|
||||
Source2: %{name}-%{version}-rpmlintrc
|
||||
Source3: kdump.service
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
# rename "kdump-helpers" (10.3) -> "kdump" (11.0/SP2)
|
||||
Provides: kdump-helpers = %{version}
|
||||
@ -50,6 +54,9 @@ Obsoletes: kdump-helpers < %{version}
|
||||
# update should detect the split-off from kexec-tools
|
||||
Provides: kexec-tools:/etc/init.d/kdump
|
||||
Requires: kexec-tools
|
||||
%if %suse_version > 1220
|
||||
%systemd_requires
|
||||
%endif
|
||||
Recommends: nfs-client cifs-utils
|
||||
PreReq: coreutils sed
|
||||
ExcludeArch: s390 s390x ppc
|
||||
@ -96,6 +103,16 @@ ln -s /etc/init.d/boot.kdump $RPM_BUILD_ROOT/sbin/rckdump
|
||||
# empty directory
|
||||
mkdir $RPM_BUILD_ROOT/var/crash
|
||||
|
||||
%if %suse_version > 1220
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||
install -m644 %{S:3} $RPM_BUILD_ROOT%{_unitdir}
|
||||
%endif
|
||||
|
||||
%if %suse_version > 1220
|
||||
%pre
|
||||
%service_add_pre kdump.service
|
||||
%endif
|
||||
|
||||
%post
|
||||
# change only permission if the file exists before /etc/sysconfig/kdump
|
||||
# has been created from /var/adm/fillup-templates/sysconfig.kdump
|
||||
@ -113,10 +130,16 @@ if test -d /var/log/dump && rmdir /var/log/dump &>/dev/null ||
|
||||
! test -d /var/log/dump ; then
|
||||
ln -snf /var/crash /var/log/dump
|
||||
fi
|
||||
%if %suse_version > 1220
|
||||
%service_add_post kdump.service
|
||||
%endif
|
||||
|
||||
%preun
|
||||
echo "Stopping kdump ..."
|
||||
%stop_on_removal boot.kdump
|
||||
%if %suse_version > 1220
|
||||
%service_del_preun kdump.service
|
||||
%endif
|
||||
|
||||
%postun
|
||||
# force regeneration of kdumprd
|
||||
@ -126,6 +149,9 @@ touch /etc/sysconfig/kdump
|
||||
rm /var/log/dump &>/dev/null || true
|
||||
%restart_on_update boot.kdump
|
||||
%insserv_cleanup
|
||||
%if %suse_version > 1220
|
||||
%service_del_postun kdump.service
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -146,5 +172,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/lib/mkinitrd/scripts/setup-kdumpfs.sh
|
||||
/lib/mkinitrd/scripts/setup-mkdumprd.sh
|
||||
%config %{_sysconfdir}/udev/rules.d/70-kdump.rules
|
||||
%if %suse_version > 1220
|
||||
%{_unitdir}/kdump.service
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
x
Reference in New Issue
Block a user