scope: Support RuntimeMaxSec= directive in scope units

Just as `RuntimeMaxSec=` is supported for service units, add support for
it to scope units. This will gracefully kill a scope after the timeout
expires from the moment the scope enters the running state.

This could be used for time-limited login sessions, for example.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #12035
This commit is contained in:
Philip Withnall
2019-10-28 09:44:31 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 7508f7f273
commit 9ed7de605d
9 changed files with 65 additions and 2 deletions
+4
View File
@@ -1402,6 +1402,10 @@ static int bus_append_path_property(sd_bus_message *m, const char *field, const
}
static int bus_append_scope_property(sd_bus_message *m, const char *field, const char *eq) {
if (streq(field, "RuntimeMaxSec"))
return bus_append_parse_sec_rename(m, field, eq);
if (streq(field, "TimeoutStopSec"))
return bus_append_parse_sec_rename(m, field, eq);