Re: [PATCH] sys-tools: Add setns utility to sys-tools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>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

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux