summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortblume <Thomas.Blume@suse.com>2016-04-26 17:10:36 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-26 17:10:36 +0200
commit959718c62107c11f1665f813e856a0a1d5b0bb7c (patch)
tree08dbc49f35e166a6fb19233e40a20ea663281395
parenta109d2e204ae9561c4a7f7982448a6ca0d318fb3 (diff)
core: set start job timeout from the kernel commandline (#3112)
Add the boot parameter: systemd.default_timeout_start_sec to allow modification of the default start job timeout at boot time.
-rw-r--r--man/kernel-command-line.xml9
-rw-r--r--src/core/main.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml
index 42d5e006bb..9c04849f66 100644
--- a/man/kernel-command-line.xml
+++ b/man/kernel-command-line.xml
@@ -322,6 +322,15 @@
</varlistentry>
<varlistentry>
+ <term><varname>systemd.default_timeout_start_sec=</varname></term>
+
+ <listitem>
+ <para>Overwrites the default start job timeout <varname>DefaultTimeoutStartSec=</varname> at boot. For details,
+ see <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><varname>modules-load=</varname></term>
<term><varname>rd.modules-load=</varname></term>
diff --git a/src/core/main.c b/src/core/main.c
index 8dfb3928de..75c5ff81f2 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -413,6 +413,15 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
target = runlevel_to_target(key);
if (target)
return free_and_strdup(&arg_default_unit, target);
+
+ } else if (streq(key, "systemd.default_timeout_start_sec") && value) {
+
+ r = parse_sec(value, &arg_default_timeout_start_usec);
+ if (r < 0)
+ log_warning_errno(r, "Failed to parse default start timeout: %s, ignoring.", value);
+
+ if (arg_default_timeout_start_usec <= 0)
+ arg_default_timeout_start_usec = USEC_INFINITY;
}
return 0;