diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-10-28 14:57:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 14:57:00 +0100 |
commit | a5f6f346d3db9061fa73527e9dba3fa6b1d80b69 (patch) | |
tree | 924f5d0a1832be95944d64183fd51e5d31d2aabc /src/shared/bus-unit-util.c | |
parent | fec837e96e902c041adae552aa3101b8a8132869 (diff) | |
parent | adc09af234047126b5ed65869d575c99dec3f9cc (diff) | |
download | systemd-a5f6f346d3db9061fa73527e9dba3fa6b1d80b69.tar.gz |
Merge pull request #13423 from pwithnall/12035-session-time-limits
Add `RuntimeMaxSec=` support to scope units (time-limited login sessions)
Diffstat (limited to 'src/shared/bus-unit-util.c')
-rw-r--r-- | src/shared/bus-unit-util.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index cdd30e1e2d..c9f352f796 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -1381,6 +1381,18 @@ static int bus_append_path_property(sd_bus_message *m, const char *field, const return 0; } +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); + + return 0; +} + static int bus_append_service_property(sd_bus_message *m, const char *field, const char *eq) { int r; @@ -1747,10 +1759,6 @@ int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const cha break; case UNIT_SCOPE: - - if (streq(field, "TimeoutStopSec")) - return bus_append_parse_sec_rename(m, field, eq); - r = bus_append_cgroup_property(m, field, eq); if (r != 0) return r; @@ -1758,6 +1766,10 @@ int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const cha r = bus_append_kill_property(m, field, eq); if (r != 0) return r; + + r = bus_append_scope_property(m, field, eq); + if (r != 0) + return r; break; case UNIT_MOUNT: |