X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=distrib%2Fredhat%2Finitpost;h=4157a2b5194c74bb8878365ebb99affab92706bf;hb=fca49fc5682f1d88f8d00c86f931431ff1c71e18;hp=d4c6a38d8e69d36a1a21d6fc7238defd2b52d1dc;hpb=9c78378bebc1a9f3d400f422df8ede9efea57dea;p=util-vserver.git diff --git a/distrib/redhat/initpost b/distrib/redhat/initpost index d4c6a38..4157a2b 100755 --- a/distrib/redhat/initpost +++ b/distrib/redhat/initpost @@ -44,7 +44,7 @@ vserver=$1 ## Do some magic to set the vserver into a defined state $_VSERVER "$vserver" stop &>/dev/null || : -$_VSERVER "$vserver" start --rescue bash -c ' +$_VSERVER "$vserver" start --rescue --rescue-init bash -c ' exec >/dev/null exec 2>/dev/null @@ -52,7 +52,7 @@ $_VSERVER "$vserver" start --rescue bash -c ' f=/tmp/startwait trap "rm -f $f" EXIT mkfifo $f - ( sleep 10; kill -s 9 -- -1 ) & + ( sleep 15; kill -s 9 -- -1 ) & cat "$f" >/dev/null kill -s 9 -- -1 wait @@ -92,14 +92,12 @@ pushd "$vdir" &>/dev/null exec /sbin/killall5 -15 EOF - # TODO: remove race/symlink-attack - chmod +x etc/init.d/halt + $_CHROOT_SH chmod 0755 /etc/init.d/halt : | $_CHROOT_SH truncate /etc/sysctl.conf echo "none / none defaults" | $_CHROOT_SH truncate /etc/fstab cat "$__DISTRIBDIR"/redhat/rc.sysinit | $_CHROOT_SH truncate /etc/rc.d/rc.sysinit.vserver - # TODO: remove race/symlink-attack - chmod +x etc/rc.d/rc.sysinit.vserver + $_CHROOT_SH chmod 0755 /etc/rc.d/rc.sysinit.vserver subst etc/inittab 's!^\([^#].*:respawn:.* tty\)!#\1!; s!si::sysinit:/etc/rc.d/rc.sysinit!si::sysinit:/etc/rc.d/rc.sysinit.vserver!' popd >/dev/null