summaryrefslogtreecommitdiff
path: root/src/shared/bus-unit-util.c
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2019-06-12 08:45:26 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-10-28 09:44:31 +0100
commit9ed7de605d7c1a3290e544e92ea5de6141c26bbc (patch)
tree2f9331649c36deec0a112f6001b46ce43b3275e4 /src/shared/bus-unit-util.c
parent7508f7f273cb2957dbdf7cd8d5d7fe040c80d8e4 (diff)
downloadsystemd-9ed7de605d7c1a3290e544e92ea5de6141c26bbc.tar.gz
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
Diffstat (limited to 'src/shared/bus-unit-util.c')
-rw-r--r--src/shared/bus-unit-util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index dc7c2f41aa..ace17da0c7 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -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);