]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: prefer shutting down through logind even as root
authorLennart Poettering <lennart@poettering.net>
Tue, 29 Sep 2015 12:00:21 +0000 (14:00 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 29 Sep 2015 19:55:53 +0000 (21:55 +0200)
Otherwise, wall messages will not be generated for root.

src/systemctl/systemctl.c

index 56852fdb92475d8a4f065cb0d2ba2e8b0ed9e621..83a29e6abc62f5adc45e43cc43cdd5124e4fcab5 100644 (file)
@@ -3136,9 +3136,8 @@ static int start_special(char **args) {
                    ACTION_EXIT))
                 return daemon_reload(args);
 
-        /* first try logind, to allow authentication with polkit */
-        if (geteuid() != 0 &&
-            IN_SET(a,
+        /* First try logind, to allow authentication with polkit */
+        if (IN_SET(a,
                    ACTION_POWEROFF,
                    ACTION_REBOOT,
                    ACTION_SUSPEND,
@@ -3150,7 +3149,8 @@ static int start_special(char **args) {
                 if (IN_SET(r, -EOPNOTSUPP, -EINPROGRESS))
                         /* requested operation is not supported or already in progress */
                         return r;
-                /* on all other errors, try low-level operation */
+
+                /* On all other errors, try low-level operation */
         }
 
         return start_unit(args);