- be quiet in the curl request
[vserver-reference.git] / vserver-reference.init
index 6033307..f31d89d 100755 (executable)
@@ -2,15 +2,17 @@
 #
 # Builds VServer reference image. Requires the web and boot servers to
 # be up, which complicates bootstrap. Alternatively, we could require
-# the build server to host a local yum repository.
+# the build server to host a local yum repository. Already, it is
+# required to run the same major version of yum as the nodes.
 #
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2004-2005 The Trustees of Princeton University
 #
-# $Id: vserver-reference.init,v 1.8 2005/03/31 22:34:42 mlhuang Exp $
+# $Id: vserver-reference.init,v 1.15 2005/09/02 01:43:49 mlhuang Exp $
 #
 
-YUM_CONF="http://www.planet-lab.org/PlanetLabConf/v3-yum.conf"
+# Get the URL for the production /etc/yum.conf file
+YUM_CONF=http://www.planet-lab.org/$(curl -q --form node_id=0 --form file=/etc/yum.conf https://www.planet-lab.org/db/plnodeconf/getsinglefile.php)
 
 # Make /vservers
 VROOT=$PWD/vservers/vserver-reference
@@ -48,7 +50,7 @@ mkdir -p $VROOT/proc
 mount -t proc none $VROOT/proc
 
 # Clean up before exiting if anything goes wrong
-trap "umount $VROOT/proc ; umount $VROOT/dev/pts" ERR
+trap "umount $VROOT/proc ; umount $VROOT/dev/pts ; exit 255" ERR
 
 # Create a dummy /etc/fstab in reference image
 mkdir -p $VROOT/etc
@@ -102,7 +104,7 @@ umount $VROOT/dev/pts
 MAKEDEV
 
 # Disable all services in reference image
-chroot $VROOT /bin/sh -c "chkconfig --list | awk '{ print \$1 }' | xargs -i chkconfig {} off"
+/usr/sbin/chroot $VROOT /bin/sh -c "/sbin/chkconfig --list | awk '{ print \$1 }' | xargs -i /sbin/chkconfig {} off"
 
 # Clean up
 umount $VROOT/proc