From 7089051f67e969a524bde5a7f264491a0373f7e5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 29 Sep 2015 14:00:21 +0200 Subject: [PATCH] systemctl: prefer shutting down through logind even as root Otherwise, wall messages will not be generated for root. --- src/systemctl/systemctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 56852fdb924..83a29e6abc6 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);