[systemd-devel] Complex supervision structures/delegating watchdog?

Mantas Mikulėnas grawity at gmail.com
Sat Feb 14 12:37:08 PST 2015


On Sat, Feb 14, 2015 at 10:31 PM, Holger Freyther <holger at freyther.de>
wrote:

> Hi,
>
> for one application we will spawn one or more pppd daemons. Once
> a link is up I would like to monitor them. The closest thing that
> I can do right now is "systemctl start mon@$PPP_IFACE" from within
> a /etc/ppp/ip-up.d/mon file.
>
> In case I consider the link broken or I want to bring it down, I
> don't know how to do it. What options do I have? I can look at
> /run/$PPP_IFACE.pid and then send a SIGHUP to the task (this
> requires that the monitor app is allowed to do that).
>

Pidfiles?

systemctl kill -s SIGHUP pppd@$PPP_IFACE.service

ExecReload=/bin/kill -HUP $MAINPID
systemctl reload pppd@$PPP_IFACE.service


> What would be neat is that if I could spawn a "watchdog" from
> with-in /etc/ppp/ip-up.d/mon for the existing service and that
> when the application exits (or doesn't respond/send watchdog
> messages to systemd) the "parent" will be stopped.
>

I wonder if you could have the pppd service automatically start the
pppd-watchdog@ service using some combination of Before=, Requires=, and
BindsTo= (or something similar that I'd forgotten). When the watchdog
process exits, the pppd-watchdog@ service fails, causing pppd@ to also fail
due to the Requires=.

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150214/4e68a3ee/attachment.html>


More information about the systemd-devel mailing list