chiark / gitweb /
logind: parse configuration file
[elogind.git] / src / logind-user.c
index a4f78869a31d1078342fdaa847c5ab506b537448..3076ed15738fb68ca5b37438315151406d1722b1 100644 (file)
@@ -246,6 +246,10 @@ static int user_create_cgroup(User *u) {
         u->cgroup_path = p;
 
         STRV_FOREACH(k, u->manager->controllers) {
+
+                if (strv_contains(u->manager->reset_controllers, *k))
+                        continue;
+
                 r = cg_create(*k, p);
                 if (r < 0)
                         log_warning("Failed to create cgroup %s:%s: %s", *k, p, strerror(-r));
@@ -285,13 +289,13 @@ int user_start(User *u) {
         if (r < 0)
                 return r;
 
-        /* Save new user data */
-        user_save(u);
-
         dual_timestamp_get(&u->timestamp);
 
         u->started = true;
 
+        /* Save new user data */
+        user_save(u);
+
         user_send_signal(u, true);
 
         return 0;
@@ -459,6 +463,9 @@ int user_check_gc(User *u) {
 
         assert(u);
 
+        if (!u->started)
+                return 0;
+
         if (u->sessions)
                 return 1;