- do not tolerate errors
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 31 Mar 2006 21:18:42 +0000 (21:18 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 31 Mar 2006 21:18:42 +0000 (21:18 +0000)
- disable all services in vserver-reference image

build.sh

index c869ec5..d8e946f 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -73,6 +73,9 @@ while getopts "c:r:a:d:s:h" opt ; do
     esac
 done
 
+# Do not tolerate errors
+set -e
+
 root=fc$releasever
 data=data$releasever
 
@@ -85,7 +88,7 @@ fi
 
 mkdir -p $root $data
 mount -o loop $root.img $root
-trap "umount $root; exit 1" ERR
+trap "umount $root" ERR
 
 #
 # Build
@@ -99,6 +102,9 @@ done < <(./plc-config --packages $config)
 # Install base system
 mkfedora -v -r $releasever -a $basearch $packages $root
 
+# Disable all services in reference image
+chroot $vroot sh -c "/sbin/chkconfig --list | awk '{ print \$1 }' | xargs -i /sbin/chkconfig {} off"
+
 # FC2 minilogd starts up during shutdown and makes unmounting
 # impossible. Just get rid of it.
 rm -f $root/sbin/minilogd