* nsenter: passing command arguments
@ 2014-04-17 8:34 Nicolas
2014-04-17 22:17 ` Bernhard Voelker
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas @ 2014-04-17 8:34 UTC (permalink / raw)
To: util-linux
Hi,
I'm struggling with nsenter to call commands with options because they
are caught by nsenter and complain this is an invalid option.
How can I pass any arbitrary argument ?
Thanks for reading,
Nicolas
```
$ nsenter --target $PID --mount --uts --ipc --net --pid ls -a
nsenter: invalid option -- 'a'
Usage:
nsenter [options] <program> [args...]
Options:
-t, --target <pid> target process to get namespaces from
-m, --mount [=<file>] enter mount namespace
-u, --uts [=<file>] enter UTS namespace (hostname etc)
-i, --ipc [=<file>] enter System V IPC namespace
-n, --net [=<file>] enter network namespace
-p, --pid [=<file>] enter pid namespace
-U, --user [=<file>] enter user namespace
-S, --setuid <uid> set uid in user namespace
-G, --setgid <gid> set gid in user namespace
-r, --root [=<dir>] set the root directory
-w, --wd [=<dir>] set the working directory
-F, --no-fork do not fork before exec'ing <program>
-h, --help display this help and exit
-V, --version output version information and exit
For more details see nsenter(1).
```
--
Nicolas Delaby · Software Engineer · ezeep.com
ezeep GmbH · Ohlauer Str. 43 · 10999 Berlin · Germany
Registry Court: Charlottenburg · HRB133318 · Managing partner: Sascha
Kellert
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nsenter: passing command arguments
2014-04-17 8:34 nsenter: passing command arguments Nicolas
@ 2014-04-17 22:17 ` Bernhard Voelker
2014-04-18 11:12 ` Karel Zak
2014-04-22 7:56 ` Nicolas
0 siblings, 2 replies; 4+ messages in thread
From: Bernhard Voelker @ 2014-04-17 22:17 UTC (permalink / raw)
To: Nicolas, util-linux
On 04/17/2014 10:34 AM, Nicolas wrote:
> Hi,
> I'm struggling with nsenter to call commands with options because they
> are caught by nsenter and complain this is an invalid option.
>
> How can I pass any arbitrary argument ?
>
> Thanks for reading,
> Nicolas
>
> ```
> $ nsenter --target $PID --mount --uts --ipc --net --pid ls -a
> nsenter: invalid option -- 'a'
Use '--' to tell nsenter to stop option parsing:
$ nsenter --target $PID --mount --uts --ipc --net --pid -- ls -a
Although I think this can be considered a bug; nsenter should
do this automatically when seeing the first non-option.
Have a nice day,
Berny
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nsenter: passing command arguments
2014-04-17 22:17 ` Bernhard Voelker
@ 2014-04-18 11:12 ` Karel Zak
2014-04-22 7:56 ` Nicolas
1 sibling, 0 replies; 4+ messages in thread
From: Karel Zak @ 2014-04-18 11:12 UTC (permalink / raw)
To: Bernhard Voelker; +Cc: Nicolas, util-linux
On Fri, Apr 18, 2014 at 12:17:06AM +0200, Bernhard Voelker wrote:
> On 04/17/2014 10:34 AM, Nicolas wrote:
> > Hi,
> > I'm struggling with nsenter to call commands with options because they
> > are caught by nsenter and complain this is an invalid option.
> >
> > How can I pass any arbitrary argument ?
> >
> > Thanks for reading,
> > Nicolas
> >
> > ```
> > $ nsenter --target $PID --mount --uts --ipc --net --pid ls -a
> > nsenter: invalid option -- 'a'
>
> Use '--' to tell nsenter to stop option parsing:
> $ nsenter --target $PID --mount --uts --ipc --net --pid -- ls -a
>
> Although I think this can be considered a bug; nsenter should
> do this automatically when seeing the first non-option.
Yep, fixed (also in unshare).
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: nsenter: passing command arguments
2014-04-17 22:17 ` Bernhard Voelker
2014-04-18 11:12 ` Karel Zak
@ 2014-04-22 7:56 ` Nicolas
1 sibling, 0 replies; 4+ messages in thread
From: Nicolas @ 2014-04-22 7:56 UTC (permalink / raw)
To: util-linux
On 04/18/2014 12:17 AM, Bernhard Voelker wrote:
> On 04/17/2014 10:34 AM, Nicolas wrote:
>> Hi,
>> I'm struggling with nsenter to call commands with options because they
>> are caught by nsenter and complain this is an invalid option.
>>
>> How can I pass any arbitrary argument ?
>>
>> Thanks for reading,
>> Nicolas
>>
>> ```
>> $ nsenter --target $PID --mount --uts --ipc --net --pid ls -a
>> nsenter: invalid option -- 'a'
>
> Use '--' to tell nsenter to stop option parsing:
> $ nsenter --target $PID --mount --uts --ipc --net --pid -- ls -a
>
> Although I think this can be considered a bug; nsenter should
> do this automatically when seeing the first non-option.
Thank you Bernhard,
It Worked like a charm :)
Have a nice day too.
Nicolas
--
Nicolas Delaby · Software Engineer · ezeep.com
ezeep GmbH · Ohlauer Str. 43 · 10999 Berlin · Germany
Registry Court: Charlottenburg · HRB133318 · Managing partner: Sascha
Kellert
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-22 7:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17 8:34 nsenter: passing command arguments Nicolas
2014-04-17 22:17 ` Bernhard Voelker
2014-04-18 11:12 ` Karel Zak
2014-04-22 7:56 ` Nicolas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox