summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-24 14:10:51 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-24 14:11:11 +0100
commitcb96a2c69a312fb089fef4501650f4fc40a1420b (patch)
treeecb9c73f5ffc7085ac8122ede0e2910ab618c52c
parentd710d36375bacbf9cfb8903107bedf2c0aada84e (diff)
downloadsystemd-cb96a2c69a312fb089fef4501650f4fc40a1420b.tar.gz
nspawn: catch config mistake of specifying -b and args
-rw-r--r--man/systemd-nspawn.xml4
-rw-r--r--src/nspawn/nspawn.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml
index 5cba40bcd4..8396def003 100644
--- a/man/systemd-nspawn.xml
+++ b/man/systemd-nspawn.xml
@@ -170,7 +170,9 @@
<listitem><para>Automatically search
for an init binary and invoke it
instead of a shell or a user supplied
- program.</para></listitem>
+ program. A command to execute cannot
+ be specified in this case.
+ </para></listitem>
</varlistentry>
<varlistentry>
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index b8962e9894..c346f58412 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -267,6 +267,11 @@ static int parse_argv(int argc, char *argv[]) {
}
}
+ if (optind < argc && arg_boot) {
+ log_error("Cannot specify a command together with '-b'");
+ return -EINVAL;
+ }
+
return 1;
}