Hide Forgot
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:
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?
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?
Right. Sorry for the noise.