4 if [ -z "${vdir}" ] ; then
6 echo "Provide the directory of the root filesystem to operate on"
10 # Remove unneeded services
11 for service in util-vserver vprocunhide vservers-default; do
12 chroot ${vdir} /sbin/chkconfig $service off
15 # Disable splaying of cron.
16 echo > ${vdir}/etc/sysconfig/crontab
18 # Add site_admin account
19 chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
21 ( cat <<EOF ) | patch -d ${vdir}/etc/init.d/
22 --- halt 2007-10-08 19:18:54.000000000 +0000
23 +++ halt2 2008-05-07 17:52:42.000000000 +0000
26 [ "\${BASH+bash}" = bash ] && enable kill
28 +action $"Sending all VServers the TERM signal..." ls -d /proc/virtual/[0-9]* | awk -F '/' '{print \$4}' | xargs -I{} /usr/sbin/vkill -s 15 --xid {} -- 0
29 action $"Sending all processes the TERM signal..." /sbin/killall5 -15
31 +action $"Sending all VServers the KILL signal..." ls -d /proc/virtual/[0-9]* | awk -F '/' '{print \$4}' | xargs -I{} /usr/sbin/vkill -s 9 --xid {} -- 0
32 action $"Sending all processes the KILL signal..." /sbin/killall5 -9
34 # Write to wtmp file before unmounting /var