systemctl: skip checking inhibitors when dbus.service is not running
Fixes a bug introduced by 804874d26a.
Fixes #35416.
This commit is contained in:
@@ -152,6 +152,9 @@ int logind_check_inhibitors(enum action a) {
|
||||
return 0;
|
||||
|
||||
r = acquire_bus(BUS_FULL, &bus);
|
||||
if (r == -ECONNREFUSED && geteuid() == 0)
|
||||
return 0; /* When D-Bus is not running, allow root to force a shutdown. E.g. when running at
|
||||
* the emergency console. */
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user