Skip to content

Commit

Permalink
Prevent from error on umount /proc if userns are used.
Browse files Browse the repository at this point in the history
Signed-off-by: Przemek Rudy <prudy1@o2.pl>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
prudy authored and stgraber committed Aug 13, 2015
1 parent 5035cbc commit 4a5911e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lxc/conf.c
Expand Up @@ -1368,10 +1368,8 @@ int prepare_ramfs_root(char *root)
break;
}

if (umount2("./proc", MNT_DETACH)) {
SYSERROR("Unable to umount /proc");
return -1;
}
/* This also can be skipped if a container uses unserns */
umount2("./proc", MNT_DETACH);

/* It is weird, but chdir("..") moves us in a new root */
if (chdir("..") == -1) {
Expand Down

0 comments on commit 4a5911e

Please sign in to comment.