From dbf9e898fea4efccceec20e6dd3f5025b0cf0222fa6ab84f8ed23cd3199ee3db Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 11 Oct 2011 13:53:44 +0000 Subject: [PATCH] - do not telinit u if /sbin/init is not sysvinit OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=149 --- sysvinit.changes | 5 +++++ sysvinit.spec | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sysvinit.changes b/sysvinit.changes index 86b8a0f..66306fc 100644 --- a/sysvinit.changes +++ b/sysvinit.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 11 13:46:46 UTC 2011 - coolo@suse.com + +- do not telinit u if /sbin/init is not sysvinit + ------------------------------------------------------------------- Tue Oct 11 11:04:56 UTC 2011 - coolo@suse.com diff --git a/sysvinit.spec b/sysvinit.spec index f1b02b3..44426fc 100644 --- a/sysvinit.spec +++ b/sysvinit.spec @@ -163,10 +163,10 @@ popd mkdir -m 755 -p ${RPM_BUILD_ROOT}%{_mandir}/man8 make install -C src MANPATH=%{_mandir} ROOT=${RPM_BUILD_ROOT} WITH_SELINUX=yes DISTRO=SuSE mv ${RPM_BUILD_ROOT}/sbin/init ${RPM_BUILD_ROOT}/sbin/sysvinit - ln -s sysvinit ${RPM_BUILD_ROOT}/sbin/init + ln -s /sbin/sysvinit ${RPM_BUILD_ROOT}/sbin/init mkdir -p ${RPM_BUILD_ROOT}/lib/sysvinit - ln -sf sysvinit ${RPM_BUILD_ROOT}/lib/sysvinit/telinit - ln -sf sysvinit ${RPM_BUILD_ROOT}/sbin/telinit + ln -sf /sbin/sysvinit ${RPM_BUILD_ROOT}/lib/sysvinit/telinit + ln -sf /sbin/sysvinit ${RPM_BUILD_ROOT}/sbin/telinit test -p ${RPM_BUILD_ROOT}/dev/initctl || { rm -f ${RPM_BUILD_ROOT}/dev/initctl mknod ${RPM_BUILD_ROOT}/dev/initctl p @@ -218,9 +218,11 @@ popd %stop_on_removal powered %post -if test -x /sbin/telinit -a -p /dev/initctl -a -f /proc/1/exe -a -d /proc/1/root -a ! -d /.build ; then - if test $(stat -Lc '%%D-%%i' /) = $(stat -Lc '%%D-%%i' /proc/1/root) ; then - /sbin/telinit u +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 fi fi