From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: [RFC PATCH user-cr] remount /proc for new pidns
Date: Thu, 3 Dec 2009 20:06:10 -0600 [thread overview]
Message-ID: <20091204020610.GA17971@us.ibm.com> (raw)
Not doing this can be a pain for restarted software which relies on
proc...
Signed-off-by: root <root-Z+ypJZ3u8cnx6HRWoRZK3AC/G2K4zDHf@public.gmane.org>
---
restart.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/restart.c b/restart.c
index d25561a..cefe639 100644
--- a/restart.c
+++ b/restart.c
@@ -1005,6 +1005,13 @@ static int ckpt_probe_child(pid_t pid, char *str)
static int __ckpt_coordinator(void *arg)
{
struct ckpt_ctx *ctx = (struct ckpt_ctx *) arg;
+ int ret;
+
+ ret = mount("proc", "/proc", "proc", 0, NULL);
+ if (ret) {
+ perror("mount -t proc proc /proc");
+ exit(1);
+ }
if (!ctx->args->wait)
close(ctx->pipe_coord[0]);
@@ -1869,6 +1876,13 @@ int ckpt_fork_stub(void *data)
struct task *task = (struct task *) data;
struct ckpt_ctx *ctx = task->ctx;
+ if (task->flags & TASK_NEWPID) {
+ int ret = mount("proc", "/proc", "proc", 0, NULL);
+ if (ret) {
+ perror("mount -t proc");
+ exit(1);
+ }
+ }
/*
* In restart into a new pid namespace (--pidns), coordinator
* is the container init, hence if it terminated permatutely
--
1.6.4.4
next reply other threads:[~2009-12-04 2:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 2:06 Serge E. Hallyn [this message]
[not found] ` <20091204020610.GA17971-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-12-10 19:04 ` [RFC PATCH user-cr] remount /proc for new pidns Serge E. Hallyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091204020610.GA17971@us.ibm.com \
--to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox