mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-04 17:47:03 +03:00
systemctl: short cut things if we aren't root and the user requested a reboot to suppress unnecessary wall message
This commit is contained in:
parent
d47b555bb6
commit
bc8c2f5c54
@ -3156,6 +3156,11 @@ static int start_with_fallback(DBusConnection *bus) {
|
||||
static int halt_main(DBusConnection *bus) {
|
||||
int r;
|
||||
|
||||
if (geteuid() != 0) {
|
||||
log_error("Must to be root.");
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
if (!arg_dry && !arg_immediate)
|
||||
return start_with_fallback(bus);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user