]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc-debian to not use empty mount table
authorMichel Normand <michel.mno@free.fr>
Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Fri, 13 Nov 2009 10:48:29 +0000 (11:48 +0100)
lxc should not save in config generated file the name of an
empty file if no additionnal mount point specified by user.

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
scripts/lxc-debian.in

index b874d046230454359b8a7ffa12ae0b528fa11ffe..7e907c5333c3b7c6be007cd8ab1c16769559b403 100755 (executable)
@@ -136,7 +136,6 @@ lxc.network.flags = up
 lxc.network.link = br0
 lxc.network.name = eth0
 lxc.network.mtu = $MTU
-lxc.mount = $TMPMNTFILE
 lxc.rootfs = $ROOTFS
 lxc.cgroup.devices.deny = a
 # /dev/null and zero
@@ -155,13 +154,18 @@ lxc.cgroup.devices.allow = c 5:2 rwm
 # rtc
 lxc.cgroup.devices.allow = c 254:0 rwm
 EOF
+
+       if [ ! -z "$TMPMNTFILE" ]; then
+cat <<EOF >> $CONFFILE
+lxc.mount = $TMPMNTFILE
+EOF
+       fi
 }
 
 write_lxc_mounts() {
 
-    TMPMNTFILE=$(mktemp lxc.XXXXXXXXXX)
-
     if [ ! -z "$MNTFILE" ]; then
+       TMPMNTFILE=$(mktemp lxc.$NAME.XXXXXXXXXX)
        cp $MNTFILE $TMPMNTFILE
     fi
 }
@@ -312,7 +316,6 @@ create() {
 
     # remove the configuration files
     rm -f $CONFFILE
-    rm -f $TMPMNTFILE
 
     if [ "$RES" != "0" ]; then
        echo "Failed to create '$NAME'"