[systemd-devel] [PATCH 1/4] WIP: service: add watchdog timestamp

Lennart Poettering lennart at poettering.net
Tue Nov 1 18:34:04 PDT 2011


On Mon, 24.10.11 18:04, Michael Olbrich (m.olbrich at pengutronix.de) wrote:

Heya,

Sorry for the delay in reviewing. We've been busy with getting F16 out
of the door and didn't want to add major new features into systemd at
that time. But now git is open for new features again.

When Kay and I first saw your patch we initially were inclined to say
"no" to this, since we didn't want to have monitoring capabilities in
systemd. It is our intention to provide the right hooks to do
monitoring, but not do the monitoring itself. i.e. provide the data that
monitoring tools need, but insist that they need to run outside of
system. Or with other words: we never ever want to see code in systemd
that is an HTTP client to check whether apache is still responding.

However, your patch is actually quite minimal and very generic, and
reuses the existing notification channel for the watchdog messages which
are just trivial extensions of it. That makes it a lot more interesting,
in particular because this means systemd never has to ask the clients,
but they have to query systemd. So, yupp, we are convinced, and would
like to merge this. 

A few review nitpicks:

> --- a/src/sd-daemon.h
> +++ b/src/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_.

Please add the same to the man page of sd_notify().

Otherwise looks flawless!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list