On Sat, Feb 14, 2015 at 10:31 PM, Holger Freyther <hol...@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 <graw...@gmail.com>
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to