summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-01-02 17:35:23 +0100
committerLennart Poettering <lennart@poettering.net>2023-01-10 18:28:38 +0100
commit5d71e463f49518c7702467f6145484afa31bf8ba (patch)
tree0384258c8af451d86bec6e10247084f60740b53b
parentf84331539deae28fbeb42d45ad0c8d583b3372a3 (diff)
downloadsystemd-5d71e463f49518c7702467f6145484afa31bf8ba.tar.gz
logind: implement Type=notify-reload protocol properly
So close already. Let's add the two missing notifications too. Fixes: #18484
-rw-r--r--src/login/logind.c6
-rw-r--r--units/systemd-logind.service.in1
2 files changed, 7 insertions, 0 deletions
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
{{SERVICE_WATCHDOG}}
# Increase the default a bit in order to allow many simultaneous logins since