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 # NOTE: this is added to ensure that processes running within the slices that
22 # may have special permissions and other parts of the filesystem engated are
23 # killed before shutdown. We experienced hangs when rebooting without this
25 ( cat <<EOF ) | patch -d ${vdir}/etc/init.d/
26 --- halt 2007-10-08 19:18:54.000000000 +0000
27 +++ halt2 2008-05-07 17:52:42.000000000 +0000
30 [ "\${BASH+bash}" = bash ] && enable kill
32 +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
33 action $"Sending all processes the TERM signal..." /sbin/killall5 -15
35 +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
36 action $"Sending all processes the KILL signal..." /sbin/killall5 -9
38 # Write to wtmp file before unmounting /var
41 # NOTE: This is added to relieve one site's Cisco router configuration that
42 # fails to recognize the host once the arping is sent out.
43 cat <<\EOF | patch -d ${vdir}/etc/sysconfig/network-scripts/
44 --- ifup-eth 2008-07-08 13:19:49.000000000 -0400
45 +++ ifup-eth-orig 2008-07-08 13:20:02.000000000 -0400
49 if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${IPADDR}/${PREFIX}" ; then
50 - if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
51 - echo $"Error, some other host already uses address ${IPADDR}."
54 + #if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
55 + # echo $"Error, some other host already uses address ${IPADDR}."
58 if ! ip addr add ${IPADDR}/${PREFIX} \
59 brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then
60 echo $"Error adding address ${IPADDR} for ${DEVICE}."