diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-02-07 16:42:03 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-02-07 17:49:16 +0100 |
commit | ba4c5d93b73ef7bba0ae0c6bf2b36a42360f7a34 (patch) | |
tree | babd4d0ff8b8bef6c892dc2ec9d5f6004d4673e9 /src | |
parent | 1a436809498faf6486815baa0338fb6b8e5def07 (diff) |
logind: order all scopes after both systemd-logind.service and
systemd-user-sessions.service
This way at shutdown we can be sure that the sessions go away before the
network.
Diffstat (limited to 'src')
-rw-r--r-- | src/login/logind-dbus.c | 10 | ||||
-rw-r--r-- | src/login/logind-session.c | 2 | ||||
-rw-r--r-- | src/login/logind.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 28b5cd49a7..30476f3ea4 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2178,7 +2178,7 @@ int manager_start_scope( pid_t pid, const char *slice, const char *description, - const char *after, + const char *after, const char *after2, sd_bus_error *error, char **job) { @@ -2219,12 +2219,18 @@ int manager_start_scope( return r; } - if (!isempty(description)) { + if (!isempty(after)) { r = sd_bus_message_append(m, "(sv)", "After", "as", 1, after); if (r < 0) return r; } + if (!isempty(after2)) { + r = sd_bus_message_append(m, "(sv)", "After", "as", 1, after2); + if (r < 0) + return r; + } + /* 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 diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 95105e5325..f661cc8b8d 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -490,7 +490,7 @@ static int session_start_scope(Session *s) { if (!scope) return log_oom(); - r = manager_start_scope(s->manager, scope, s->leader, s->user->slice, description, "systemd-logind.service", &error, &job); + r = manager_start_scope(s->manager, scope, s->leader, s->user->slice, description, "systemd-logind.service", "systemd-user-session.service", &error, &job); if (r < 0) { log_error("Failed to start session scope %s: %s %s", scope, bus_error_message(&error, r), error.name); diff --git a/src/login/logind.h b/src/login/logind.h index c1a5b6a80f..0bf52daeb1 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -162,7 +162,7 @@ int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_ int manager_dispatch_delayed(Manager *manager); -int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, sd_bus_error *error, char **job); +int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *after2, sd_bus_error *error, char **job); int manager_start_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error); |