summaryrefslogtreecommitdiffstats
path: root/src/shared/daemon-util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
commitfc53809803cd2bc2434e312b19a18fa36776da12 (patch)
treeb4b43bd6538f51965ce32856e9c053d0f90919c8 /src/shared/daemon-util.c
parentAdding upstream version 255.5. (diff)
downloadsystemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz
systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shared/daemon-util.c')
-rw-r--r--src/shared/daemon-util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/daemon-util.c b/src/shared/daemon-util.c
index 32180a1..aa386b4 100644
--- a/src/shared/daemon-util.c
+++ b/src/shared/daemon-util.c
@@ -4,6 +4,7 @@
#include "fd-util.h"
#include "log.h"
#include "string-util.h"
+#include "time-util.h"
static int notify_remove_fd_warn(const char *name) {
int r;
@@ -74,3 +75,18 @@ int notify_push_fdf(int fd, const char *format, ...) {
return notify_push_fd(fd, name);
}
+
+int notify_reloading_full(const char *status) {
+ int r;
+
+ r = sd_notifyf(/* unset_environment = */ false,
+ "RELOADING=1\n"
+ "MONOTONIC_USEC=" USEC_FMT
+ "%s%s",
+ now(CLOCK_MONOTONIC),
+ status ? "\nSTATUS=" : "", strempty(status));
+ if (r < 0)
+ return log_debug_errno(r, "Failed to notify service manager for reloading status: %m");
+
+ return 0;
+}