Bug 693185 - systemd-nspawn invalid excess arguments error
Summary: systemd-nspawn invalid excess arguments error
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-03 12:23 UTC by Albert Strasheim
Modified: 2011-04-04 18:58 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-04 18:34:14 UTC
Type: ---


Attachments (Terms of Use)

Description Albert Strasheim 2011-04-03 12:23:23 UTC
Description of problem:

I'm trying to run systemd under strace in a systemd-nspawn container:

systemd-nspawn -D root -- /usr/bin/strace -f /bin/systemd systemd.log_level=debug

I'm getting an Excess arguments error.

Version-Release number of selected component (if applicable):

systemd-22-1.fc15.x86_64

How reproducible:

Always

Steps to Reproduce:
1. systemd-nspawn -D root -- /usr/bin/strace -f /bin/systemd systemd.log_level=debug
  
Actual results:

Excess arguments error.

Expected results:

systemd-nspawn should not try to interpret arguments after --, which would avoid it from being confused by arguments I am trying to pass to strace.

Additional info:

Comment 1 Albert Strasheim 2011-04-03 12:48:54 UTC
The error is coming from systemd, not systemd-nspawn.

The excess arguments is happening because systemd isn't running as PID=1 and does a check like this:

if (getpid() != 1 && optind < argc) {
  return -EINVAL;
}

which makes me wonder if in fact the example in the systemd-nspawn manual page which suggests passing systemd.log_level=debug as a parameter to systemd might be wrong?

Comment 2 Lennart Poettering 2011-04-04 18:34:14 UTC
Hmm? if you run "systemd-nspawn -D root -- /usr/bin/strace -f /bin/systemd systemd.log_level=debug" then strace starts as PID 1, and systemd is forked off that and gets PID 2. However, when it is PID 2 it cannot act as init system and chooses to run as user sessoin manager instead which takes no additional argument.

The example in the man page is correct, since it does not involve strace and hence systemd is started as PID 1.

So I see nothing wrong here?

Comment 3 Albert Strasheim 2011-04-04 18:58:39 UTC
Right. Sorry for the noise.


Note You need to log in before you can comment on or make changes to this bug.