Skip to content

Commit

Permalink
core: set start job timeout from the kernel commandline (systemd#3112)
Browse files Browse the repository at this point in the history
Add the boot parameter: systemd.default_timeout_start_sec to allow modification
of the default start job timeout at boot time.
  • Loading branch information
tblume authored and poettering committed Apr 26, 2016
1 parent a109d2e commit 959718c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions man/kernel-command-line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,15 @@
</listitem>
</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>
Expand Down
9 changes: 9 additions & 0 deletions src/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 959718c

Please sign in to comment.