diff --git a/man/sd_notify.xml b/man/sd_notify.xml
index 078f1ff7e0..4a5e087af7 100644
--- a/man/sd_notify.xml
+++ b/man/sd_notify.xml
@@ -204,6 +204,14 @@
watchdog is enabled.
+
+ WATCHDOG_USEC=…
+
+ Reset watchdog_usec value during runtime.
+ Notice that this is not available when using sd_event_set_watchdog()
+ or sd_watchdog_enabled().
+ Example : WATCHDOG_USEC=20000000
+
FDSTORE=1
@@ -249,15 +257,6 @@
restrictions, it is ignored.
-
- WATCHDOG_USEC=…
-
- Reset watchdog_usec value during runtime.
- Notice that this is not available when using sd_event_set_watchdog()
- or sd_watchdog_enabled().
- Example : WATCHDOG_USEC=20000000
-
-
It is recommended to prefix variable names that are not
diff --git a/src/core/service.c b/src/core/service.c
index add054b785..0beb25b860 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -3457,6 +3457,15 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
if (strv_find(tags, "WATCHDOG=1"))
service_reset_watchdog(s);
+ e = strv_find_startswith(tags, "WATCHDOG_USEC=");
+ if (e) {
+ usec_t watchdog_override_usec;
+ if (safe_atou64(e, &watchdog_override_usec) < 0)
+ log_unit_warning(u, "Failed to parse WATCHDOG_USEC=%s", e);
+ else
+ service_reset_watchdog_timeout(s, watchdog_override_usec);
+ }
+
if (strv_find(tags, "FDSTORE=1")) {
const char *name;
@@ -3469,15 +3478,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
service_add_fd_store_set(s, fds, name);
}
- e = strv_find_startswith(tags, "WATCHDOG_USEC=");
- if (e) {
- usec_t watchdog_override_usec;
- if (safe_atou64(e, &watchdog_override_usec) < 0)
- log_unit_warning(u, "Failed to parse WATCHDOG_USEC=%s", e);
- else
- service_reset_watchdog_timeout(s, watchdog_override_usec);
- }
-
/* Notify clients about changed status or main pid */
if (notify_dbus)
unit_add_to_dbus_queue(u);
diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h
index 61cfdd8e0a..54e82562a7 100644
--- a/src/systemd/sd-daemon.h
+++ b/src/systemd/sd-daemon.h
@@ -204,17 +204,17 @@ int sd_is_mq(int fd, const char *path);
timestamps to detect failed services. Also see
sd_watchdog_enabled() below.
+ WATCHDOG_USEC=...
+ Reset watchdog_usec value during runtime.
+ To reset watchdog_usec value, start the service again.
+ Example: "WATCHDOG_USEC=20000000"
+
FDSTORE=1 Store the file descriptors passed along with the
message in the per-service file descriptor store,
and pass them to the main process again on next
invocation. This variable is only supported with
sd_pid_notify_with_fds().
- WATCHDOG_USEC=...
- Reset watchdog_usec value during runtime.
- To reset watchdog_usec value, start the service again.
- Example: "WATCHDOG_USEC=20000000"
-
Daemons can choose to send additional variables. However, it is
recommended to prefix variable names not listed above with X_.