chiark / gitweb /
event: hook up sd-event with the service watchdog logic
authorLennart Poettering <lennart@poettering.net>
Wed, 11 Dec 2013 17:14:52 +0000 (18:14 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Dec 2013 17:20:09 +0000 (18:20 +0100)
commitcde93897cdefdd7c7f66c400a61e42ceee5f6a46
tree2ad9106709282c4f853bdcb3e2ea6446260ee743
parent08cd15525450ff2c2ac814a58930f6d82284a1ba
event: hook up sd-event with the service watchdog logic

Adds a new call sd_event_set_watchdog() that can be used to hook up the
event loop with the watchdog supervision logic of systemd. If enabled
and $WATCHDOG_USEC is set the event loop will ping the invoking systemd
daemon right after coming back from epoll_wait() but not more often than
$WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than
$WATCHDOG_USEC/4*3, to make sure the service manager is called in time.

This means that setting WatchdogSec= in a .service file and calling
sd_event_set_watchdog() in your daemon is enough to hook it up with the
watchdog logic.
19 files changed:
Makefile.am
TODO
src/hostname/hostnamed.c
src/libsystemd-bus/libsystemd-bus.sym
src/libsystemd-bus/sd-event.c
src/libsystemd-bus/test-event.c
src/locale/localed.c
src/login/logind.c
src/machine/machined.c
src/network/networkd-manager.c
src/socket-proxy/socket-proxyd.c
src/systemd/sd-event.h
src/timedate/timedated.c
units/systemd-hostnamed.service.in
units/systemd-localed.service.in
units/systemd-logind.service.in
units/systemd-machined.service.in
units/systemd-networkd.service.in
units/systemd-timedated.service.in