smoother set up of systemd in lxc for f20
[build.git] / vbuild-init-vserver.sh
index bff3cb8..1e8ef4a 100755 (executable)
@@ -85,7 +85,7 @@ function package_method () {
     fcdistro=$1; shift
     case $fcdistro in
        f[0-9]*|centos[0-9]*|sl[0-9]*) echo yum ;;
-       squeeze|wheezy|oneiric|precise|quantal|raring) echo debootstrap ;;
+       squeeze|wheezy|oneiric|precise|quantal|raring|saucy) echo debootstrap ;;
        *) echo Unknown distro $fcdistro ;;
     esac 
 }
@@ -96,7 +96,7 @@ function debian_mirror () {
     case $fcdistro in
        squeeze|wheezy) 
            echo http://ftp2.fr.debian.org/debian/ ;;
-       oneiric|precise|quantal|raring) 
+       oneiric|precise|quantal|raring|saucy
            echo http://mir1.ovh.net/ubuntu/ubuntu/ ;;
        *) echo unknown distro $fcdistro; exit 1;;
     esac
@@ -214,6 +214,7 @@ function setup_vserver () {
     # not working with f16 anyways, systemd requires 2.6.36 to work
     case $fcdistro in 
        f1[5-9]) echo plain > /etc/vservers/$vserver/apps/init/style ;;
+       f2?)     echo plain > /etc/vservers/$vserver/apps/init/style ;;
     esac
 
     if [ "$pkg_method" = "yum" ] ; then
@@ -244,11 +245,11 @@ function setup_vserver () {
 #    fi
 
     # start the vserver so we can do the following operations
-    # with ubuntu/raring, somehow the vserver is already running at this point
-    $personality vserver $vserver status >& /dev/null || \
-      # redirect out/err to protect against the vserver's init sequence getting stalled 
-      # mostly used for f10 vservers created remotely through ssh
-      $personality vserver $VERBOSE $vserver start >& /dev/null
+    # redirect out/err to protect against the vserver's init sequence getting stalled 
+    # mostly used for f10 vservers created remotely through ssh
+    # with ubuntu/raring, somehow this fails, so ignore retcod, 
+    # as subsequent vserver exec will fail anyway
+    $personality vserver $VERBOSE $vserver start >& /dev/null || :
 
     if [ "$pkg_method" == "yum" ] ; then
        $personality vserver $VERBOSE $vserver exec sh -c "rm -f /var/lib/rpm/__db*"
@@ -276,6 +277,10 @@ function setup_vserver () {
 
        # try the simple way, if that fails try to cross fix the rpm hashes
        $personality vserver $VERBOSE $vserver exec rpm --rebuilddb || translate_rpm_hashes $personality $vserver
+      
+    elif [ "$pkg_method" == "debootstrap" ] ; then
+       # just check the vm is running
+       $personality vserver $VERBOSE $vserver exec arch 
     fi
 
     # check if the vserver kernel is using VSERVER_DEVICE (vdevmap) support