diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-07-10 23:39:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-07-10 23:41:04 +0200 |
commit | 7fb3ee51c1b37738fd0ea2c81dfd6c336144698a (patch) | |
tree | 1a0def1b9d80726c7c12d2154446b48cb25c3fca /src/login/logind-dbus.c | |
parent | f2d4f98d5873e0649b79b04b967fc9625ab3a350 (diff) |
user-sessions: rely on PID 1 to kill sessions
As we want to centralized cgroup access we should stop killing the user
sessions directly from the systemd-user-sessions service. Instead, rely
on PID 1 doing this by adding the right ordering dependencies to the
session scope units.
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r-- | src/login/logind-dbus.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index ec46fdc232..39af637d1b 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2518,6 +2518,7 @@ int manager_start_scope( pid_t pid, const char *slice, const char *description, + const char *after, DBusError *error, char **job) { @@ -2575,6 +2576,20 @@ int manager_start_scope( return log_oom(); } + if (!isempty(after)) { + const char *after_property = "After"; + + if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2) || + !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &after_property) || + !dbus_message_iter_open_container(&sub2, DBUS_TYPE_VARIANT, "as", &sub3) || + !dbus_message_iter_open_container(&sub3, DBUS_TYPE_ARRAY, "s", &sub4) || + !dbus_message_iter_append_basic(&sub4, DBUS_TYPE_STRING, &after) || + !dbus_message_iter_close_container(&sub3, &sub4) || + !dbus_message_iter_close_container(&sub2, &sub3) || + !dbus_message_iter_close_container(&sub, &sub2)) + return log_oom(); + } + /* cgroup empty notification is not available in containers * currently. To make this less problematic, let's shorten the * stop timeout for sessions, so that we don't wait |