summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-29 14:00:21 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-29 21:55:53 +0200
commit7089051f67e969a524bde5a7f264491a0373f7e5 (patch)
tree0b1dab540df5eca2b754992588171ed6d5087564 /src/systemctl
parent57ab90065d550b5f86e67f5d9ebc40f8a4c1297d (diff)
systemctl: prefer shutting down through logind even as root
Otherwise, wall messages will not be generated for root.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 56852fdb92..83a29e6abc 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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);