unit: when JobTimeoutSec= is turned off, implicitly turn off JobRunningTimeoutSec= too

We added JobRunningTimeoutSec= late, and Dracut configured only
JobTimeoutSec= to turn of root device timeouts before. With this change
we'll propagate a reset of JobTimeoutSec= into JobRunningTimeoutSec=,
but only if the latter wasn't set explicitly.

This should restore compatibility with older systemd versions.

Fixes: #6402
This commit is contained in:
Lennart Poettering
2017-10-05 13:06:44 +02:00
parent c9905d4dd2
commit eae51da36e
5 changed files with 81 additions and 2 deletions
+4
View File
@@ -1082,7 +1082,11 @@ int parse_sec(const char *t, usec_t *usec) {
}
int parse_sec_fix_0(const char *t, usec_t *usec) {
assert(t);
assert(usec);
t += strspn(t, WHITESPACE);
if (streq(t, "0")) {
*usec = USEC_INFINITY;
return 0;