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:
parent
57ab90065d
commit
7089051f67
@ -3136,9 +3136,8 @@ static int start_special(char **args) {
|
|||||||
ACTION_EXIT))
|
ACTION_EXIT))
|
||||||
return daemon_reload(args);
|
return daemon_reload(args);
|
||||||
|
|
||||||
/* first try logind, to allow authentication with polkit */
|
/* First try logind, to allow authentication with polkit */
|
||||||
if (geteuid() != 0 &&
|
if (IN_SET(a,
|
||||||
IN_SET(a,
|
|
||||||
ACTION_POWEROFF,
|
ACTION_POWEROFF,
|
||||||
ACTION_REBOOT,
|
ACTION_REBOOT,
|
||||||
ACTION_SUSPEND,
|
ACTION_SUSPEND,
|
||||||
@ -3150,7 +3149,8 @@ static int start_special(char **args) {
|
|||||||
if (IN_SET(r, -EOPNOTSUPP, -EINPROGRESS))
|
if (IN_SET(r, -EOPNOTSUPP, -EINPROGRESS))
|
||||||
/* requested operation is not supported or already in progress */
|
/* requested operation is not supported or already in progress */
|
||||||
return r;
|
return r;
|
||||||
/* on all other errors, try low-level operation */
|
|
||||||
|
/* On all other errors, try low-level operation */
|
||||||
}
|
}
|
||||||
|
|
||||||
return start_unit(args);
|
return start_unit(args);
|
||||||
|
Loading…
Reference in New Issue
Block a user