From: Lennart Poettering Date: Tue, 29 Sep 2015 12:00:21 +0000 (+0200) Subject: systemctl: prefer shutting down through logind even as root X-Git-Tag: v227~62^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7089051f67e969a524bde5a7f264491a0373f7e5;p=thirdparty%2Fsystemd.git systemctl: prefer shutting down through logind even as root Otherwise, wall messages will not be generated for root. --- 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);