<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>As I understand, the application has to periodically send the
      notification to systemd service manager. I am not sure if this
      will help with kamailio multiprocesses, when each of them can
      hung, not only the main process.</p>
    <p>Anyhow, there is systemdops module that tries to collect the
      features related to systemd.</p>
    <p>The best would be if there is a shutdown time limit that systemd
      can watch and if not, do kill -9.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 26.06.21 19:08, Sergey Safarov
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAHtxdDfVn8Ofn3y-9-4kfzmAkzTeafjwfP9D8hx2_akofTm=Xw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">I have observed a case when Kamaili debug module
        try to grab the lock on shutdown and not able to do it.
        <div>As a result, the Kamailio process is stuck and not able to
          restart (dead lock).</div>
        <div><br>
        </div>
        <div>To resolve such a case i want to utilize systemd watchdog
          feature</div>
        <div><a
href="https://www.freedesktop.org/software/systemd/man/sd_watchdog_enabled.html#"
            moz-do-not-send="true">https://www.freedesktop.org/software/systemd/man/sd_watchdog_enabled.html#</a><br>
        </div>
        <div><br>
        </div>
        <div>To use this feature I need send  sd_notify(3) with a
          message string of "WATCHDOG=1" from main process</div>
        <div><a
href="https://www.freedesktop.org/software/systemd/man/sd_watchdog_enabled.html#"
            moz-do-not-send="true">https://www.freedesktop.org/software/systemd/man/sd_watchdog_enabled.html#</a><br>
        </div>
        <div><br>
        </div>
        <div>According to systemd doc only one process to send watchdog</div>
        <div>If the $WATCHDOG_USEC environment variable is set, and the
          $WATCHDOG_PID variable is unset or set to the PID of the
          current process, the service manager expects notifications
          from this process.<br>
        </div>
        <div>
          <div><a
href="https://www.freedesktop.org/software/systemd/man/sd_watchdog_enabled.html#"
              moz-do-not-send="true">https://www.freedesktop.org/software/systemd/man/sd_watchdog_enabled.html#</a><br>
          </div>
          <div> </div>
        </div>
        <div>Additional info at</div>
        <div><a
href="https://lists.freedesktop.org/archives/systemd-devel/2018-January/040185.html"
            moz-do-not-send="true">https://lists.freedesktop.org/archives/systemd-devel/2018-January/040185.html</a></div>
        <div><br>
        </div>
        <div>Could you suggest how to embed this systemd call to the
          main process?<br>
          <br>
        </div>
        <div>Sergey</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Development Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.kamailio.org">sr-dev@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
  </body>
</html>