Dr. Werner Fink 2013-04-24 09:00:05 +00:00 committed by Git OBS Bridge
parent fae4b203a7
commit bfcf5dd080
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Apr 24 08:49:40 UTC 2013 - werner@suse.de
- Add sanity check for /etc/inittab to avoid reload on systemd
systems (bnc#813510)
-------------------------------------------------------------------
Mon Mar 4 16:16:45 UTC 2013 - coolo@suse.com

View File

@ -32,6 +32,8 @@ BuildRequires: audit-devel
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: pam-devel
Requires(post): coreutils grep mkinitrd
Requires(postun): mkinitrd
Url: http://savannah.nongnu.org/projects/sysvinit/
Source: sysvinit-%{SIVER}dsf.tar.bz2
Source2: killproc-%{KPVER}.tar.bz2
@ -234,16 +236,22 @@ popd
%stop_on_removal powerd
%post
ret=0
if test -x /sbin/telinit -a -p /dev/initctl -a -f /proc/1/exe -a -d /proc/1/root -a ! -d /.build -a -x /sbin/init; then
if test $(stat -Lc '%%D-%%i' /) = $(stat -Lc '%%D-%%i' /proc/1/root); then
if test $(stat -Lc '%%D-%%i' /sbin/init) = $(stat -Lc '%%D-%%i' /sbin/sysvinit); then
/sbin/telinit u
fi
icount=$(grep -cE '^[[:alnum:]]+:[[:alnum:]]*:' /etc/inittab 2>/dev/null || echo 0)
if test $(stat -Lc '%%D-%%i' /) = $(stat -Lc '%%D-%%i' /proc/1/root) -a $icount -gt 6 ; then
if test $(stat -Lc '%%D-%%i' /sbin/init) = $(stat -Lc '%%D-%%i' /sbin/sysvinit); then
/sbin/telinit u
fi
elif test $icount -le 6 ; then
echo 'Broken /etc/inittab found, installing and using %{name} make no sense!' 1>&2
ret=1
fi
fi
if test -x /sbin/mkinitrd_setup; then
mkinitrd_setup
fi
exit $ret
%postun tools
%restart_on_update powerd