An issue when restart dbus.service.
To reproduce
Steps to reproduce the behavior:
- restart dbus.service
- login by ssh.
Additional context
After the following commit has been submitted into systemd. when restart dbus.service, it is hard to login by ssh. And this issue can be solved by restart systemd-logind.service. I'm not sure whether it is an issue.
commit 5d71e463f49518c7702467f6145484afa31bf8ba
Author: Lennart Poettering <lennart@poettering.net>
Date: Mon Jan 2 17:35:23 2023 +0100
logind: implement Type=notify-reload protocol properly
So close already. Let's add the two missing notifications too.
Fixes: #18484
diff --git a/src/login/logind.c b/src/login/logind.c
index def2f5a442..1feacd3601 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1020,6 +1020,11 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
Manager *m = userdata;
int r;
+ (void) sd_notifyf(/* unset= */ false,
+ "RELOADING=1\n"
+ "STATUS=Reloading configuration...\n"
+ "MONOTONIC_USEC=" USEC_FMT, now(CLOCK_MONOTONIC));
+
manager_reset_config(m);
r = manager_parse_config_file(m);
if (r < 0)
@@ -1027,6 +1032,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
else
log_info("Config file reloaded.");
+ (void) sd_notify(/* unset= */ false, NOTIFY_READY);
return 0;
}
diff --git a/units/systemd-logind.service.in b/units/systemd-logind.service.in
index 042ea75d7a..24f5ddaa17 100644
--- a/units/systemd-logind.service.in
+++ b/units/systemd-logind.service.in
@@ -58,6 +58,7 @@ StateDirectory=systemd/linger
SystemCallArchitectures=native
SystemCallErrorNumber=EPERM
SystemCallFilter=@system-service
+Type=notify-reload
After restart dbus.service:
root # systemctl status dbus
● dbus.service - D-Bus System Message Bus
Loaded: loaded (/lib/systemd/system/dbus.service; static)
Active: active (running) since Tue 2023-05-23 15:51:50 UTC; 1 day 18h ago
TriggeredBy: ● dbus.socket
Docs: man:dbus-daemon(1)
Main PID: 39754 (dbus-daemon)
CGroup: /system.slice/dbus.service
└─39754 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
May 24 11:24:21 ubinux-x86-64 dbus-daemon[39754]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service' requeste>
May 24 11:24:46 ubinux-x86-64 dbus-daemon[39754]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
May 24 11:45:05 ubinux-x86-64 dbus-daemon[39754]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service' requeste>
May 24 11:45:30 ubinux-x86-64 dbus-daemon[39754]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
May 25 09:17:23 ubinux-x86-64 dbus-daemon[39754]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service' requeste>
May 25 09:17:48 ubinux-x86-64 dbus-daemon[39754]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
May 25 09:18:13 ubinux-x86-64 dbus-daemon[39754]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service' requeste>
May 25 09:18:38 ubinux-x86-64 dbus-daemon[39754]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
May 25 09:50:12 ubinux-x86-64 dbus-daemon[39754]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' re>
May 25 09:50:12 ubinux-x86-64 dbus-daemon[39754]: [system] Successfully activated service 'org.freedesktop.hostname1'