]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/service.c
service: add watchdog timestamp
authorMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 1 Feb 2012 16:17:12 +0000 (17:17 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 1 Feb 2012 18:29:19 +0000 (19:29 +0100)
commita6927d7ffc18c51fbb9940f5f1e89f5c7695ed63
treea56630fa33002013683a69126a2caec16ef31b6c
parentc4aa65e7147dc742886edf25593e10466b02fc3a
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.
man/sd_notify.xml
src/dbus-service.c
src/service.c
src/service.h
src/systemd/sd-daemon.h