From: Neil Horman <nhorman@tuxdriver.com>
To: util-linux@vger.kernel.org
Cc: Karel Zak <kzak@redhat.com>, grawity@gmail.com
Subject: Re: [PATCH] sys-tools: Add setns utility to sys-tools
Date: Wed, 19 Dec 2012 16:01:10 -0500 [thread overview]
Message-ID: <20121219210110.GE4390@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1355944006-27234-1-git-send-email-nhorman@tuxdriver.com>
>>On 2012-12-19 21:06, Neil Horman wrote:
>> ...
>> +.BR \-u\ <pid> , " \-\-uts=<pid>"
>> +Migrate to the uts namespace of <pid>
>> +.TP
>> +.BR \-i\ <pid> , " \-\-ipc=<pid>"
>> +Migrate to the ipc namespace of <pid>
>> +.TP
>> +.BR \-n\ <pid> , " \-\-net\<pid>"
>> +Migrate to the net namespace of <pid>
>
>Wouldn't it be more useful to accept an arbitrary path, and just hand it
>to setns(2)? That way, the utility would automatically gain support for
>new namespace types (for example `setns /proc/$pid/ns/mount`), and would
>allow joining namespaces that are linked outside /proc.
>
>For example, I seem to remember someone saying that `mount --bind
>/proc/$pid/ns/net /tmp/foo-namespace` can be used to make that
>particular namespace persist even after the process quits. Then `setns
>/tmp/foo-namespace someprogram` could be used to join that namespace again.
Yeah, that makes sense, I'll respin this tomorrow, and repost. I'm also going
to batch the namespace switches, by opening all the file descriptors first, then
calling setns on them. It was pointed out to me by doing them one by one like
this, if you setns the mount namespace you might loose access to the paths that
were specified.
Thanks!
Neil
next prev parent reply other threads:[~2012-12-19 21:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 19:06 [PATCH] sys-tools: Add setns utility to sys-tools Neil Horman
2012-12-19 20:16 ` Mantas M.
2012-12-19 21:01 ` Neil Horman [this message]
2012-12-19 23:15 ` Sami Kerola
2012-12-20 9:24 ` Karel Zak
2012-12-20 11:17 ` Sami Kerola
2012-12-20 15:34 ` Neil Horman
2012-12-20 18:22 ` [PATCH v2] sys-tools: Enhance unshare command to support the switching of namespaces Neil Horman
2012-12-28 12:54 ` Ángel González
2012-12-28 16:12 ` Neil Horman
2012-12-28 19:33 ` Ángel González
2012-12-28 21:26 ` Neil Horman
2012-12-28 16:22 ` [PATCH v3] " Neil Horman
2013-01-02 21:33 ` Neil Horman
2013-01-07 14:05 ` Karel Zak
2013-01-07 14:58 ` Neil Horman
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=20121219210110.GE4390@hmsreliant.think-freely.org \
--to=nhorman@tuxdriver.com \
--cc=grawity@gmail.com \
--cc=kzak@redhat.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