Skip to contentSkip to conversation

restart: unshare mounts ns when unsharing pidns (for --pidns)

PATCH Applied Serge E. Hallyn 2 participants 2 messages Mar 24, 2010 – Mar 30, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 restart: unshare mounts ns when unsharing pidns (for --pidns)

NOTE - this is against Suka's latest user-cr patchset. Without this patch, the cr_tests/simple testcase ends up remounting /proc at restart without having unshared mounts. Therefore, after running the testcase no tasks show up in /proc.

With this patch on top of Suka's user-cr patchset, all cr_tests pass.

---
 restart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
restart.c +1 -1
index 484668a..677033d 100644
@@ -554,7 +554,7 @@ int app_restart(struct app_restart_args *args)
 		ret = ckpt_coordinator_pidns(&ctx);
 	} else if (ctx.args->pidns) {
 		ckpt_dbg("new pidns with init\n");
-		ctx.tasks_arr[0].flags |= TASK_NEWPID;
+		ctx.tasks_arr[0].flags |= TASK_NEWPID | TASK_NEWNS;
 		if (global_send_sigint == -1)
 			global_send_sigint = SIGKILL;
 		ret = ckpt_coordinator(&ctx);
Signature · 1 line
1.7.0

A message that is not in the archive (sent off-list or not yet received): 20100324160251.GA18717-r/[email protected]

Applied
#2 lore raw

Applied in ckpt-v20-dev.

Quoted 26 lines · Serge E. Hallyn

NOTE - this is against Suka's latest user-cr patchset. Without this patch, the cr_tests/simple testcase ends up remounting /proc at restart without having unshared mounts. Therefore, after running the testcase no tasks show up in /proc.

With this patch on top of Suka's user-cr patchset, all cr_tests pass.

---
 restart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
restart.c +1 -1
index 484668a..677033d 100644
@@ -554,7 +554,7 @@ int app_restart(struct app_restart_args *args)
 		ret = ckpt_coordinator_pidns(&ctx);
 	} else if (ctx.args->pidns) {
 		ckpt_dbg("new pidns with init\n");
-		ctx.tasks_arr[0].flags |= TASK_NEWPID;
+		ctx.tasks_arr[0].flags |= TASK_NEWPID | TASK_NEWNS;
 		if (global_send_sigint == -1)
 			global_send_sigint = SIGKILL;
 		ret = ckpt_coordinator(&ctx);