4 if [ -z "${vdir}" ] ; then
6 echo "Provide the directory of the root filesystem to operate on"
10 # NOTE: we're enabling util-vserver to allow it to help shutdown all slices
11 # before rebooting. This has been problematic in the past.
12 for service in util-vserver; do
13 chroot ${vdir} /sbin/chkconfig $service on
16 # Remove unneeded services
17 for service in vprocunhide vservers-default; do
18 chroot ${vdir} /sbin/chkconfig $service off
21 # Disable splaying of cron.
22 echo > ${vdir}/etc/sysconfig/crontab
24 # Add site_admin account
25 chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
27 # NOTE: Removed due to incompatibility between fedora and centos, and b/c we
28 # expect that enabling util-vserver above will help with shutdown.
30 # : this is added to ensure that processes running within the slices that
31 # may have special permissions and other parts of the filesystem engated are
32 # killed before shutdown. We experienced hangs when rebooting without this
34 #( cat <<EOF ) | patch -d ${vdir}/etc/init.d/
35 #--- halt 2007-10-08 19:18:54.000000000 +0000
36 #+++ halt2 2008-05-07 17:52:42.000000000 +0000
38 # # Kill all processes.
39 # [ "\${BASH+bash}" = bash ] && enable kill
41 #+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
42 # action $"Sending all processes the TERM signal..." /sbin/killall5 -15
44 #+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
45 # action $"Sending all processes the KILL signal..." /sbin/killall5 -9
47 # # Write to wtmp file before unmounting /var
50 # NOTE: This is added to relieve one site's Cisco router configuration that
51 # fails to recognize the host once the arping is sent out.
52 cat <<\EOF | patch -d ${vdir}/etc/sysconfig/network-scripts/
53 --- ifup-eth 2008-07-08 13:19:49.000000000 -0400
54 +++ ifup-eth-orig 2008-07-08 13:20:02.000000000 -0400
58 if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${IPADDR}/${PREFIX}" ; then
59 - if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
60 - echo $"Error, some other host already uses address ${IPADDR}."
63 + #if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
64 + # echo $"Error, some other host already uses address ${IPADDR}."
67 if ! ip addr add ${IPADDR}/${PREFIX} \
68 brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then
69 echo $"Error adding address ${IPADDR} for ${DEVICE}."