[lxc-devel] [PATCH] Prevent from error on umount /proc if userns are used.
Przemek Rudy
prudy1 at o2.pl
Wed Jul 29 17:41:28 UTC 2015
Signed-off-by: Przemek Rudy <prudy1 at o2.pl>
---
This patch solves the problem when umounting /proc causes error
preventing from container startup. This happens when initram
together with userns are used. In such case umount fails, which
is expected and should not result in permanent error.
src/lxc/conf.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 9870455..e6e2a4a 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -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) {
--
2.4.3
More information about the lxc-devel
mailing list