From: Karel Zak <kzak@redhat.com>
To: Assaf Gordon <assafgordon@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: correct usage of unshare+nsenter for persistent namespaces?
Date: Mon, 27 Mar 2017 13:41:22 +0200 [thread overview]
Message-ID: <20170327114122.f5mulpy62jcaq4du@ws.net.home> (raw)
In-Reply-To: <20170310175156.GB21783@gmail.com>
On Fri, Mar 10, 2017 at 05:51:57PM +0000, Assaf Gordon wrote:
> IIUC, this is a kernel limitation:
> If the program which is PID1 inside the container
> terminates, there is no way to re-enter the PID namespace
> (http://man7.org/linux/man-pages/man7/pid_namespaces.7.html).
>
> Is that correct?
Yes, this namespace is strictly based on the within namespace init
process.
> If so, perhaps it would be helpful to add a caveat in the
> unshare/nsenter man pages, saying the PID namespace will
> not persist if the process termintes?
Added.
> There are already some examples of minimal 'init' for containers:
> https://github.com/Yelp/dumb-init
> https://github.com/krallin/tini
> and most minimal: https://gist.github.com/rofl0r/6168719
>
> I wonder if you will be willing to consider a patch to add
> something like 'unshare --do-nothing-init' which
> will simply create a process that does nothing except handling signals
> and never terminates, to facilitate truly persistent namespaces with
> unshare(1) ? (if so I'm happy to try and write it).
Hmm, when I think about it I'm not able to see any argument against
this feature :-) So go ahead.
Important is keep it simple and stupid and avoid arbitrary additional
features. I think for serious containers people will use another
solutions (systemd etc.).
> The working URL seems like 'www.kernel.org' (www. instead of ftp.):
> https://www.kernel.org/pub/linux/utils/util-linux/
Ah, thanks! (Seems my template is a little bit obsolete. Fixed.)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2017-03-27 11:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-10 17:51 correct usage of unshare+nsenter for persistent namespaces? Assaf Gordon
2017-03-27 11:41 ` Karel Zak [this message]
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=20170327114122.f5mulpy62jcaq4du@ws.net.home \
--to=kzak@redhat.com \
--cc=assafgordon@gmail.com \
--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