diff options
Diffstat (limited to 'main/lxc/lxc.initd')
-rw-r--r-- | main/lxc/lxc.initd | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/lxc/lxc.initd b/main/lxc/lxc.initd index faf6fa9d15..b2c99ec7ff 100644 --- a/main/lxc/lxc.initd +++ b/main/lxc/lxc.initd @@ -68,6 +68,14 @@ start() { rm -f /var/log/lxc/${CONTAINER}.log rootpath=$(lxc_get_var lxc.rootfs) + # verify that container is not on tmpfs + dev=$(df -P "${rootpath}" | awk '{d=$1}; END {print d}') + type=$(awk -v dev="$dev" '$1 == dev {m=$3}; END {print m}' /proc/mounts) + if [ "$type" = tmpfs ] && ! yesno "$ALLOW_TMPFS"; then + eerror "${rootpath} is on tmpfs and ALLOW_TMPFS is not set" + return 1 + fi + checkpath -d ${pidfile%/*} ebegin "Starting container ${CONTAINER}" start-stop-daemon --start $command \ |