aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Hallyn <serge.hallyn@canonical.com>2012-02-07 09:08:37 -0600
committerDaniel Lezcano <daniel.lezcano@free.fr>2012-02-26 10:44:40 +0100
commit721d262cf10111af48514ec90cf85c88f8335aff (patch)
tree421c70ef0a67fd17cc775412c7f8581a45b83f04
parentDon't raise error if container didn't sys_reboot (diff)
downloadlxc-721d262cf10111af48514ec90cf85c88f8335aff.tar.gz
lxc-721d262cf10111af48514ec90cf85c88f8335aff.tar.bz2
lxc-721d262cf10111af48514ec90cf85c88f8335aff.zip
if lxc-init can't mount /dev/shm, don't fail.
The 'lxc-init' (a lightweight init process used by lxc-execute in place of upstart etc) tries to mount /dev/shm during startup. If that fails (for instance /dev/shm does not exist) then it aborts execution and returns -1. This is unreasonable as very few applications actually need /dev/shm. Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
-rw-r--r--src/lxc/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 4647bd4..d96914b 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -131,8 +131,9 @@ extern int lxc_setup_fs(void)
if (mount_fs("proc", "/proc", "proc"))
return -1;
+ /* if we can't mount /dev/shm, continue anyway */
if (mount_fs("shmfs", "/dev/shm", "tmpfs"))
- return -1;
+ DEBUG("failed to mount /dev/shm");
/* If we were able to mount /dev/shm, then /dev exists */
/* Sure, but it's read-only per config :) */