systemctl: skip checking inhibitors when dbus.service is not running

Fixes a bug introduced by 804874d26a.

Fixes #35416.
This commit is contained in:
Yu Watanabe
2024-12-01 14:00:55 +09:00
parent 144d291f18
commit a1417e5563
+3
View File
@@ -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;