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>
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
# 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
}
# remove the configuration files
rm -f $CONFFILE
- rm -f $TMPMNTFILE
if [ "$RES" != "0" ]; then
echo "Failed to create '$NAME'"