public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] sys-tools: Add setns utility to sys-tools
Date: Thu, 20 Dec 2012 10:24:39 +0100	[thread overview]
Message-ID: <20121220092439.GA30947@x2.net.home> (raw)
In-Reply-To: <1355944006-27234-1-git-send-email-nhorman@tuxdriver.com>

On Wed, Dec 19, 2012 at 02:06:46PM -0500, Neil Horman wrote:
> Like the unshare command, which lets a user from the command line detach from
> specific namespaces of the parent process, and execute a command, setns provides
> a frontend to the setns(2) syscall, which allows a user to migrate a process to
> the namespaces of other processes, prior to calling exec on a command.

Do we really need a new command? Can't we extend unshare(1)?

 create a new namespace:

    unshare --{mount,ipc,...} <program> [<args>]
    
 move to already existing namespace:

    unshare --namespace <pid> --{ipc,...} <program> [<args>]


>From user's point of view in both cases the <program> will be unshared
from the current namespace so the util name seems OK.

IMHO it seems better then add a new command.


If you really want to support direct namespace paths (/proc/<pid>/ns/<nsname>)
then we can use

    unshare --namespace <path> <program> [<args>]

anyway this way should be optional and not required. It's naive to
expect that everyone remembers and understands all the /proc tricks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  parent reply	other threads:[~2012-12-20  9:24 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
2012-12-19 23:15   ` Sami Kerola
2012-12-20  9:24 ` Karel Zak [this message]
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=20121220092439.GA30947@x2.net.home \
    --to=kzak@redhat.com \
    --cc=nhorman@tuxdriver.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