monitor libvirt for both master and 1.0
[build.git] / vbuild-init-lxc.sh
index 5105cd4..9e1dd8b 100755 (executable)
@@ -161,7 +161,7 @@ function prepare_host() {
        git pull
        git checkout $lxc_version
         ./autogen.sh
-        ./configure --prefix=/usr --exec-prefix=/usr
+        ./configure --prefix=/usr --exec-prefix=/usr --disable-apparmor
         make
         make install
         mkdir -p /usr/var/lib/
@@ -261,13 +261,20 @@ function configure_fedora_init() {
 
 
 function configure_fedora_systemd() {
-
     unlink ${rootfs_path}/etc/systemd/system/default.target
+    ln -s /lib/systemd/system/multi-user.target ${rootfs_path}/etc/systemd/system/default.target
     touch ${rootfs_path}/etc/fstab
-    chroot ${rootfs_path} ln -s /dev/null //etc/systemd/system/udev.service
-    chroot ${rootfs_path} ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
-    #dependency on a device unit fails it specially that we disabled udev
-    sed -i 's/After=dev-%i.device/After=/' ${rootfs_path}/lib/systemd/system/getty\@.service
+    ln -s /dev/null ${rootfs_path}/etc/systemd/system/udev.service
+# Thierry - Feb 2013
+# this was intended for f16 initially, in order to enable getty that otherwise would not start
+# having a getty running is helpful only if ssh won't start though, and we see a correlation between
+# VM's that refuse to lxc-stop and VM's that run crazy getty's
+# so, turning getty off for now instead
+#   #dependency on a device unit fails it specially that we disabled udev
+#    sed -i 's/After=dev-%i.device/After=/' ${rootfs_path}/lib/systemd/system/getty\@.service
+    ln -s /dev/null ${rootfs_path}/etc/systemd/system/"getty@.service"
+    rm -f ${rootfs_path}/etc/systemd/system/getty.target.wants/*service || :
+# can't seem to handle this one with systemctl
     chroot ${rootfs_path} chkconfig network on
 }
 
@@ -594,12 +601,6 @@ function setup_lxc() {
 
     [ -z $ssh_up ] && echo "SSHD in container $lxc is not running"
    
-    # set hostname for fedora18
-    if [[ "$fcdistro" == "f18" ]] ; then 
-       echo $HOSTNAME
-       #ssh -o "StrictHostKeyChecking no" $IP "hostnamectl set-hostname '$HOSTNAME'" 
-    fi
-
     # rpm --rebuilddb
     chroot $rootfs_path rpm --rebuilddb
     #ssh -o "StrictHostKeyChecking no" $IP "rpm --rebuilddb"
@@ -892,7 +893,8 @@ function main () {
     else
         [[ -z "$REPO_URL" ]] && usage
         [[ -z "$IP" ]] && usage
-        NETMASK=$(ifconfig br0 | grep 'inet addr' | awk '{print $4}' | sed -e 's/.*://')
+       
+        NETMASK=$(ifconfig br0 | grep 'inet ' | awk '{print $4}' | sed -e 's/.*://')
         GATEWAY=$(route -n | grep 'UG' | awk '{print $2}')
         [[ -z "$HOSTNAME" ]] && usage
         lxc_network_type=veth