From 565f3d91a297b289be56e0b9e6ea860911de42b0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 16 Nov 2018 12:15:50 +0100 Subject: [PATCH] man: document systemd-run-generator --- man/kernel-command-line.xml | 11 +++++ man/rules/meson.build | 1 + man/systemd-run-generator.xml | 82 +++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 man/systemd-run-generator.xml diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml index 43b3a3667e..7e4b51eb9f 100644 --- a/man/kernel-command-line.xml +++ b/man/kernel-command-line.xml @@ -91,6 +91,17 @@ + + systemd.run= + systemd.run_success_action= + systemd.run_failure_action= + + Additional parameters understood by + systemd-run-generator8, to + run a command line specified on the kernel command line as system service after booting up. + + + systemd.early_core_pattern= diff --git a/man/rules/meson.build b/man/rules/meson.build index b93ed99713..b091859829 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -737,6 +737,7 @@ manpages = [ '8', ['systemd-rfkill', 'systemd-rfkill.socket'], 'ENABLE_RFKILL'], + ['systemd-run-generator', '8', [], ''], ['systemd-run', '1', [], ''], ['systemd-sleep.conf', '5', ['sleep.conf.d'], ''], ['systemd-socket-activate', '1', [], ''], diff --git a/man/systemd-run-generator.xml b/man/systemd-run-generator.xml new file mode 100644 index 0000000000..20eb6916eb --- /dev/null +++ b/man/systemd-run-generator.xml @@ -0,0 +1,82 @@ + + + + + + + + systemd-run-generator + systemd + + + + systemd-run-generator + 8 + + + + systemd-run-generator + Generator for invoking commands specified on the kernel command line as system service + + + + /usr/lib/systemd/system-generators/systemd-run-generator + + + + Description + + systemd-run-generator is a generator + that reads the kernel command line and understands three + options: + + If the option is specified and followed by a command line, a unit named + kernel-command-line.service is generated for it and booted into. The service has + Type=oneshot set, and has SuccessAction=exit and + FailureAction=exit configured by default, thus ensuring that the system is shut down as soon as + the command completes. The exit status of the command line is propagated to the invoking container manager, if + this applies (which might propagate this further, to the calling shell — e.g. + systemd-nspawn7 does this). If + this option is used multiple times the unit file will contain multiple ExecStart= lines, to + execute all commands in order. The command is started as regular service, i.e. with + DefaultDependencies= on. + + Use and to tweak + how to react to the process completing. In particular assigning none will leave the system + running after the command completes. For further details on supported arguments, see + systemd.unit5. + + systemd-run-generator implements + systemd.generator7. + + + + Example + + Use a command like the following to add a user to the user database inside a container run with + systemd-nspawn7: + + # systemd-nspawn -D mycontainer -b systemd.run='"adduser test"' + (Note the requirement for double quoting in the command line above. The first level of quoting ('') is + processed and removed by the command shell used to invoke systemd-nspawn. The second level of + quoting ("") is propagated to the kernel command line of the container and processed and removed by + systemd-run-generator. Both together make sure both words of the specified command line + adduser test end up in the generated unit file together and are neither split apart by the + command shell nor by the generator.) + + + + See Also + + systemd1, + systemctl1, + kernel-command-line7, + systemd-nspawn7, + systemd.unit5, + systemd.service5 + + + +