Changed the patch to reflect current ifup-eth script.
[build.git] / config.planetlab / bootstrapfs.post
index 1de09d7..0d20058 100644 (file)
@@ -25,6 +25,10 @@ echo > ${vdir}/etc/sysconfig/crontab
 # Add site_admin account
 chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
 
+# NOTE: this is added to ensure that processes running within the slices that
+# may have special permissions and other parts of the filesystem engated are
+# killed before shutdown.  We experienced hangs when rebooting without this
+# step.
 ( cat <<EOF ) | patch -d ${vdir}/etc/init.d/
 --- halt        2007-10-08 19:18:54.000000000 +0000
 +++ halt2       2008-05-07 17:52:42.000000000 +0000
@@ -41,23 +45,25 @@ chroot ${vdir} /usr/sbin/useradd -p "" -u 502 -m site_admin
  # Write to wtmp file before unmounting /var
 EOF
 
-
-( cat <<EOF ) | patch -d ${vdir}/etc/sysconfig/network-scripts/
---- ifup-eth    2008-05-30 13:20:17.382681663 +0000
-+++ ifup-eth-fixed      2008-06-03 16:41:25.284200756 +0000
-@@ -214,10 +214,10 @@
-         /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
+# NOTE:  This is added to relieve one site's Cisco router configuration that
+# fails to recognize the host once the arping is sent out.
+cat <<\EOF | patch -d ${vdir}/etc/sysconfig/network-scripts/
+--- ifup-eth   2008-07-08 13:19:49.000000000 -0400
++++ ifup-eth-orig      2008-07-08 13:20:02.000000000 -0400
+@@ -263,10 +263,10 @@
      fi
-
--    if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
--       echo $"Error, some other host already uses address ${IPADDR}."
--       exit 1
--    fi
-+#    if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
-+#      echo $"Error, some other host already uses address ${IPADDR}."
-+#      exit 1
-+#    fi
-
-     if [ "${DEVICE}" = "lo" ]; then
-        SCOPE="scope host"
+     
+     if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${IPADDR}/${PREFIX}" ; then
+-       if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
+-          echo $"Error, some other host already uses address ${IPADDR}."
+-          exit 1
+-       fi
++       #if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
++       #   echo $"Error, some other host already uses address ${IPADDR}."
++       #   exit 1
++       #fi
+        if ! ip addr add ${IPADDR}/${PREFIX} \
+           brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then
+           echo $"Error adding address ${IPADDR} for ${DEVICE}."
 EOF
+