1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00

systemctl: prefer shutting down through logind even as root

Otherwise, wall messages will not be generated for root.
This commit is contained in:
Lennart Poettering 2015-09-29 14:00:21 +02:00
parent 57ab90065d
commit 7089051f67

View 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);