Commit 1846e71a by Michel Normand Committed by Daniel Lezcano

lxc-debian to not use empty mount table

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: 's avatarMichel Normand <michel_mno@laposte.net> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent ab2d32f8
...@@ -136,7 +136,6 @@ lxc.network.flags = up ...@@ -136,7 +136,6 @@ lxc.network.flags = up
lxc.network.link = br0 lxc.network.link = br0
lxc.network.name = eth0 lxc.network.name = eth0
lxc.network.mtu = $MTU lxc.network.mtu = $MTU
lxc.mount = $TMPMNTFILE
lxc.rootfs = $ROOTFS lxc.rootfs = $ROOTFS
lxc.cgroup.devices.deny = a lxc.cgroup.devices.deny = a
# /dev/null and zero # /dev/null and zero
...@@ -155,13 +154,18 @@ lxc.cgroup.devices.allow = c 5:2 rwm ...@@ -155,13 +154,18 @@ lxc.cgroup.devices.allow = c 5:2 rwm
# rtc # rtc
lxc.cgroup.devices.allow = c 254:0 rwm lxc.cgroup.devices.allow = c 254:0 rwm
EOF EOF
if [ ! -z "$TMPMNTFILE" ]; then
cat <<EOF >> $CONFFILE
lxc.mount = $TMPMNTFILE
EOF
fi
} }
write_lxc_mounts() { write_lxc_mounts() {
TMPMNTFILE=$(mktemp lxc.XXXXXXXXXX)
if [ ! -z "$MNTFILE" ]; then if [ ! -z "$MNTFILE" ]; then
TMPMNTFILE=$(mktemp lxc.$NAME.XXXXXXXXXX)
cp $MNTFILE $TMPMNTFILE cp $MNTFILE $TMPMNTFILE
fi fi
} }
...@@ -312,7 +316,6 @@ create() { ...@@ -312,7 +316,6 @@ create() {
# remove the configuration files # remove the configuration files
rm -f $CONFFILE rm -f $CONFFILE
rm -f $TMPMNTFILE
if [ "$RES" != "0" ]; then if [ "$RES" != "0" ]; then
echo "Failed to create '$NAME'" echo "Failed to create '$NAME'"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment