From: ebiederm@xmission.com (Eric W. Biederman)
To: Karel Zak <kzak@redhat.com>
Cc: Lubomir Rintel <lkundrak@v3.sk>,
util-linux@vger.kernel.org,
Mikhail Gusarov <dottedmag@dottedmag.net>
Subject: Re: [PATCH 2/2] unshare: allow persisting namespaces
Date: Tue, 06 Jan 2015 11:44:53 -0600 [thread overview]
Message-ID: <87d26rolbe.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <20150106172134.GJ18528@x2.net.home> (Karel Zak's message of "Tue, 6 Jan 2015 18:21:34 +0100")
Karel Zak <kzak@redhat.com> writes:
> On Tue, Jan 06, 2015 at 11:11:49AM -0600, Eric W. Biederman wrote:
>> No. An empty pid namespace is valid. An empty pid namespace is one
>> in which an init process has not entered the pid namespace, or one in
>
> but if I create a PID namespace (unshare/clone) then then I'm the init
> process.... how I can create empty PID namespace (from userspace)?
Unshare creates an empty PID namespace. Your first child when you fork
becomes the init process. You can not change your current pid namespace
only the pid namespace for your children.
>> which the init process has exited (and thus no more processes are
>> allowed).
>
> yes, this makes sense
>
>> So an empty pid namespace is a little weird but valid.
>>
>> The implementation details of the patch completely baffle me. I can't
>> see a reason for things being implemented with clone for example.
>
> Yes, this part of the patch is strange, but I like the basic idea
> of the patch -- so make it possible to create an empty namespace and
> then later enter by nsenter.
The idea of making a new namespace and making it possible to enter it
later with nsenter seems reasonable.
But really that should be just a matter of adding the C equivalent of
"mount --bind /proc/self/ns/$TYPE $FILENAME" which should be a very
trivial addition to unshare.
Eric
next prev parent reply other threads:[~2015-01-06 17:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-28 20:23 [PATCH 1/2] unshare: add some examples Lubomir Rintel
2014-12-28 20:23 ` [PATCH 2/2] unshare: allow persisting namespaces Lubomir Rintel
2015-01-06 13:03 ` Karel Zak
2015-01-06 17:11 ` Eric W. Biederman
2015-01-06 17:21 ` Karel Zak
2015-01-06 17:44 ` Eric W. Biederman [this message]
2015-02-15 12:10 ` Mike Frysinger
2015-01-12 11:41 ` [PATCH 1/2] unshare: add some examples Karel Zak
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=87d26rolbe.fsf@x220.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=dottedmag@dottedmag.net \
--cc=kzak@redhat.com \
--cc=lkundrak@v3.sk \
--cc=util-linux@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).