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:
Petr Tesařík 2013-09-05 12:03:56 +00:00 committed by Git OBS Bridge
parent dbb4fded67
commit 9346aee607
3 changed files with 47 additions and 0 deletions

View File

@ -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 Wed Jan 2 16:05:51 UTC 2013 - ptesarik@suse.cz

12
kdump.service Normal file
View 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

View File

@ -40,9 +40,13 @@ BuildRequires: zlib-devel
%if %suse_version > 1100 %if %suse_version > 1100
BuildRequires: libssh2-devel BuildRequires: libssh2-devel
%endif %endif
%if %suse_version > 1220
BuildRequires: systemd
%endif
PreReq: %insserv_prereq %fillup_prereq mkinitrd PreReq: %insserv_prereq %fillup_prereq mkinitrd
Source: %{name}-%{version}.tar.bz2 Source: %{name}-%{version}.tar.bz2
Source2: %{name}-%{version}-rpmlintrc Source2: %{name}-%{version}-rpmlintrc
Source3: kdump.service
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# rename "kdump-helpers" (10.3) -> "kdump" (11.0/SP2) # rename "kdump-helpers" (10.3) -> "kdump" (11.0/SP2)
Provides: kdump-helpers = %{version} Provides: kdump-helpers = %{version}
@ -50,6 +54,9 @@ Obsoletes: kdump-helpers < %{version}
# update should detect the split-off from kexec-tools # update should detect the split-off from kexec-tools
Provides: kexec-tools:/etc/init.d/kdump Provides: kexec-tools:/etc/init.d/kdump
Requires: kexec-tools Requires: kexec-tools
%if %suse_version > 1220
%systemd_requires
%endif
Recommends: nfs-client cifs-utils Recommends: nfs-client cifs-utils
PreReq: coreutils sed PreReq: coreutils sed
ExcludeArch: s390 s390x ppc ExcludeArch: s390 s390x ppc
@ -96,6 +103,16 @@ ln -s /etc/init.d/boot.kdump $RPM_BUILD_ROOT/sbin/rckdump
# empty directory # empty directory
mkdir $RPM_BUILD_ROOT/var/crash 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 %post
# change only permission if the file exists before /etc/sysconfig/kdump # change only permission if the file exists before /etc/sysconfig/kdump
# has been created from /var/adm/fillup-templates/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 ! test -d /var/log/dump ; then
ln -snf /var/crash /var/log/dump ln -snf /var/crash /var/log/dump
fi fi
%if %suse_version > 1220
%service_add_post kdump.service
%endif
%preun %preun
echo "Stopping kdump ..." echo "Stopping kdump ..."
%stop_on_removal boot.kdump %stop_on_removal boot.kdump
%if %suse_version > 1220
%service_del_preun kdump.service
%endif
%postun %postun
# force regeneration of kdumprd # force regeneration of kdumprd
@ -126,6 +149,9 @@ touch /etc/sysconfig/kdump
rm /var/log/dump &>/dev/null || true rm /var/log/dump &>/dev/null || true
%restart_on_update boot.kdump %restart_on_update boot.kdump
%insserv_cleanup %insserv_cleanup
%if %suse_version > 1220
%service_del_postun kdump.service
%endif
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -146,5 +172,8 @@ rm -rf $RPM_BUILD_ROOT
/lib/mkinitrd/scripts/setup-kdumpfs.sh /lib/mkinitrd/scripts/setup-kdumpfs.sh
/lib/mkinitrd/scripts/setup-mkdumprd.sh /lib/mkinitrd/scripts/setup-mkdumprd.sh
%config %{_sysconfdir}/udev/rules.d/70-kdump.rules %config %{_sysconfdir}/udev/rules.d/70-kdump.rules
%if %suse_version > 1220
%{_unitdir}/kdump.service
%endif
%changelog %changelog