]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: implement Type=notify-reload protocol properly
authorLennart Poettering <lennart@poettering.net>
Mon, 2 Jan 2023 16:35:23 +0000 (17:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Jan 2023 17:28:38 +0000 (18:28 +0100)
So close already. Let's add the two missing notifications too.

Fixes: #18484
src/login/logind.c
units/systemd-logind.service.in

index def2f5a44286f3b4d2fc6629507659f9c53b92fc..1feacd360113fbfc4aad8621a556dcb6adc1acc5 100644 (file)
@@ -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;
 }
 
index 042ea75d7abd6e04c069ad55b492ec672aea072d..24f5ddaa17303b1c963133ab0ab7ff8c5b8a1982 100644 (file)
@@ -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