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
19 # update /etc/sysconfig/network-scripts/ifup
20 # #if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
21 #echo $"Error, some other host already uses address ${IPADDR}."
25 # Add site_admin account
26 chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
28 ( cat <<EOF ) | patch -d ${vdir}/etc/init.d/
29 --- halt 2007-10-08 19:18:54.000000000 +0000
30 +++ halt2 2008-05-07 17:52:42.000000000 +0000
33 [ "\${BASH+bash}" = bash ] && enable kill
35 +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
36 action $"Sending all processes the TERM signal..." /sbin/killall5 -15
38 +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
39 action $"Sending all processes the KILL signal..." /sbin/killall5 -9
41 # Write to wtmp file before unmounting /var
45 ( cat <<EOF ) | patch -d ${vdir}/etc/sysconfig/network-scripts/
46 --- ifup-eth 2008-05-30 13:20:17.382681663 +0000
47 +++ ifup-eth-fixed 2008-06-03 16:41:25.284200756 +0000
49 /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
52 - if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
53 - echo $"Error, some other host already uses address ${IPADDR}."
56 +# if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
57 +# echo $"Error, some other host already uses address ${IPADDR}."
61 if [ "${DEVICE}" = "lo" ]; then