chiark / gitweb /
logind: order all scopes after both systemd-logind.service and
authorLennart Poettering <lennart@poettering.net>
Fri, 7 Feb 2014 15:42:03 +0000 (16:42 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Feb 2014 16:49:16 +0000 (17:49 +0100)
systemd-user-sessions.service

This way at shutdown we can be sure that the sessions go away before the
network.

src/login/logind-dbus.c
src/login/logind-session.c
src/login/logind.h

index 28b5cd4..30476f3 100644 (file)
@@ -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
index 95105e5..f661cc8 100644 (file)
@@ -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);
index c1a5b6a..0bf52da 100644 (file)
@@ -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);