<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Thanks David and </span><span style="font-family:arial,sans-serif;font-size:13px">Zbyszek</span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Yes with BindsTo parameter it works</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
David</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"> I was trying out the options in the unit file hence PID parameter came in. I forgot to remove that later :-(</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">some more questions in the same thread - </div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"> 1. How do I trace the heartbeat message - or rather can I capture the systemd-notify messages being sent by the process. </div>
<div style="font-family:arial,sans-serif;font-size:13px"> 2. Is there any way I can see whether systemd captured the notification or missed it. The reason why I am asking this is - my process runs for some time and all the while it sends WATCHDOG notification in every 5 seconds. But systemd made the process failed saying watchdog timeout.</div>
<div style="font-family:arial,sans-serif;font-size:13px"> 3. One more use case I can think of is - if the process fail to send heartbeat message ( WATCHDOG ) for some time and later it starts sending - because of some time. So during the time WATCHDOG notification is missing process can be marked as failed and the moment notification start coming, can it be marked as active-running ?</div>
<div style="font-family:arial,sans-serif;font-size:13px"> 4. Is there way systemd can notify me in case a watchdog timeout happens for a service - like systemd calls some program or write to some socket etc. So basically in case any service fails because of watchdog timeout, I would like to know asynchronously. Is there any way I can configure this. </div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif">Thanks</font></div><div style="font-family:arial,sans-serif;font-size:13px">
<font face="arial, sans-serif">Salil</font></div><div class="" style="font-family:arial,sans-serif;font-size:13px"></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 21 November 2013 09:02, David Timothy Strauss <span dir="ltr"><<a href="mailto:david@davidstrauss.net" target="_blank">david@davidstrauss.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The service configuration is strange. Normally, this is how they work<br>
with dependencies:<br>
<br>
* Type=simple considers the service started immediately on exec()<br>
with no respect for PIDFiles or sd_notify. This can cause dependent<br>
services to come up too early.<br>
* Type=forking considers the service started when either the file<br>
specified in PIDFile= appears or when the service completes a double<br>
fork.<br>
* Type=notify is like Type=simple, except that it relies on sd_notify<br>
to indicate final startup.<br>
* Type=bus is like Type=simple, except that it waits for the dbus<br>
listener to indicate final startup.<br>
<br>
You have PIDFile= specified, which is for Type=forking. I think<br>
PIDFile= just gets ignored for Type=simple (the default). So, for one,<br>
I'd pick a more coherent startup-detection configuration.<br>
<br>
More interesting is how Myservice gets marked "failed" but isn't<br>
forcibly stopped. That may be why systemd isn't bringing down<br>
dependent services. Most services only get marked "failed" after<br>
stopping (because of a non-zero exit code, for example).<br>
</blockquote></div><br></div>