Commit 6e46cfcb by Serge Hallyn

conf.c: if we don't specify a rootfs, we still need proc mounted

otherwise we won't be allowed to set an apparmor context (on pid 1) Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent fabf7361
...@@ -2851,9 +2851,13 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf) ...@@ -2851,9 +2851,13 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
#if HAVE_APPARMOR /* || HAVE_SMACK || HAVE_SELINUX */ #if HAVE_APPARMOR /* || HAVE_SMACK || HAVE_SELINUX */
INFO("rootfs path is .%s., mount is .%s.", lxc_conf->rootfs.path, INFO("rootfs path is .%s., mount is .%s.", lxc_conf->rootfs.path,
lxc_conf->rootfs.mount); lxc_conf->rootfs.mount);
if (lxc_conf->rootfs.path == NULL || strlen(lxc_conf->rootfs.path) == 0) if (lxc_conf->rootfs.path == NULL || strlen(lxc_conf->rootfs.path) == 0) {
mounted = 0; if (mount("proc", "/proc", "proc", 0, NULL)) {
else SYSERROR("Failed mounting /proc, proceeding");
mounted = 0;
} else
mounted = 1;
} else
mounted = lsm_mount_proc_if_needed(lxc_conf->rootfs.path, lxc_conf->rootfs.mount); mounted = lsm_mount_proc_if_needed(lxc_conf->rootfs.path, lxc_conf->rootfs.mount);
if (mounted == -1) { if (mounted == -1) {
SYSERROR("failed to mount /proc in the container."); SYSERROR("failed to mount /proc in the container.");
......
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