summaryrefslogtreecommitdiff
path: root/src/systemd
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-02-01 17:17:12 +0100
committerLennart Poettering <lennart@poettering.net>2012-02-01 19:29:19 +0100
commita6927d7ffc18c51fbb9940f5f1e89f5c7695ed63 (patch)
treea56630fa33002013683a69126a2caec16ef31b6c /src/systemd
parentc4aa65e7147dc742886edf25593e10466b02fc3a (diff)
service: add watchdog timestamp
This patch adds WatchdogTimestamp[Monotonic] to the systemd service D-Bus API. The timestamp is updated to the current time when the service calls 'sd_nofity("WATCHDOG=1\n")'. Using a timestamp instead of an 'alive' flag has two advantages: 1. No timeout is needed to define when a service is no longer alive. This simplifies both configuration (no timeout value) and implementation (no timeout event). 2. It is more robust. A 'dead' service might not be detected should systemd 'forget' to reset an 'alive' flag. It is much less likely to get a valid new timestamp if a service died.
Diffstat (limited to 'src/systemd')
-rw-r--r--src/systemd/sd-daemon.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h
index eb2a60651..7b664bf42 100644
--- a/src/systemd/sd-daemon.h
+++ b/src/systemd/sd-daemon.h
@@ -217,6 +217,11 @@ int sd_is_mq(int fd, const char *path);
MAINPID=... The main pid of a daemon, in case systemd did not
fork off the process itself. Example: "MAINPID=4711"
+ WATCHDOG=1 Tells systemd to update the watchdog timestamp.
+ Services using this feature should do this in
+ regular intervals. A watchdog framework can use the
+ timestamps to detect failed services.
+
Daemons can choose to send additional variables. However, it is
recommended to prefix variable names not listed above with X_.