From: Yu Watanabe Date: Fri, 29 Nov 2024 17:52:01 +0000 (+0900) Subject: systemctl: skip checking inhibitors when dbus.service is not running X-Git-Tag: v257~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1417e5563acb73a0accdc12b3af91e4ec1c7f46;p=thirdparty%2Fsystemd.git systemctl: skip checking inhibitors when dbus.service is not running Fixes a bug introduced by 804874d26ac73e0af07c4c5d7165c95372f03f6d. Fixes #35416. --- diff --git a/src/systemctl/systemctl-logind.c b/src/systemctl/systemctl-logind.c index fc64e60c64b..1258852a016 100644 --- a/src/systemctl/systemctl-logind.c +++ b/src/systemctl/systemctl-logind.c @@ -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;