<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 14, 2015 at 10:31 PM, Holger Freyther <span dir="ltr"><<a href="mailto:holger@freyther.de" target="_blank">holger@freyther.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
for one application we will spawn one or more pppd daemons. Once<br>
a link is up I would like to monitor them. The closest thing that<br>
I can do right now is "systemctl start mon@$PPP_IFACE" from within<br>
a /etc/ppp/ip-up.d/mon file.<br>
<br>
In case I consider the link broken or I want to bring it down, I<br>
don't know how to do it. What options do I have? I can look at<br>
/run/$PPP_IFACE.pid and then send a SIGHUP to the task (this<br>
requires that the monitor app is allowed to do that).<br></blockquote><div><br></div><div>Pidfiles?</div><div><br></div><div>systemctl kill -s SIGHUP pppd@$PPP_IFACE.service</div><div><br></div><div>ExecReload=/bin/kill -HUP $MAINPID</div><div>systemctl reload pppd@$PPP_IFACE.service</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
What would be neat is that if I could spawn a "watchdog" from<br>
with-in /etc/ppp/ip-up.d/mon for the existing service and that<br>
when the application exits (or doesn't respond/send watchdog<br>
messages to systemd) the "parent" will be stopped.<br></blockquote><div><br></div><div>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=.</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>