From a9becdd65bb4b64675bc0c109d14ab12b1ecd2b7 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 21 Oct 2014 18:44:09 -0400 Subject: sd-daemon,man: ignore missing $WATCHDOG_PID Systemd 209 started setting $WATCHDOG_PID, and sd-daemon watch was modified to check for this variable. This means that sd_watchdog_enabled() stopped working with previous versions of systemd. But sd-event is a public library and API and we must keep it working even when a program compiled with a newer version of the libary is used on a system running an older version of the manager. getenv() and unsetenv() are fairly expensive calls, so optimize sd_watchdog_enabled() by not calling them when unnecessary. man: centralize the description of $WATCHDOG_PID and $WATCHDOG_USEC in the sd_watchdog_enabled manpage. It is better not to repeat the same stuff in two places. --- man/sd_notify.xml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'man/sd_notify.xml') diff --git a/man/sd_notify.xml b/man/sd_notify.xml index fbb882dfd2..35f6f71ab3 100644 --- a/man/sd_notify.xml +++ b/man/sd_notify.xml @@ -192,17 +192,12 @@ WatchdogSec= is enabled for it. See systemd.service5 - for details. It is recommended to send - this message if the - $WATCHDOG_PID - environment variable has been set to - the PID of the service process, in - every half the time interval that is - specified in the - $WATCHDOG_USEC - environment variable. See + for information how to enable this + functionality and sd_watchdog_enabled3 - for details. + for the details of how the service can + check if the the watchdog is enabled. + -- cgit v1.2.3-54-g00ecf