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