<p>I made this patch to ensure kamailio exits with an unclean status if it stops due to a child exits. This allows systemd's unit <code>Restart=on-failure</code> parameter to actually automatically restart kamailio, in a segfault or any other signal-throwing situation.</p>

<p>The side effect is that it would trigger a kamailio restart if one of the children is stopped with a TERM signal, but I considered here that the only clean way to stop kamailio is to send a signal to the main attendant process, and not to a child.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/403'>https://github.com/kamailio/kamailio/pull/403</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>core: exit with failure code if a child dies</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/403/files#diff-0">main.c</a>
    (6)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/403.patch'>https://github.com/kamailio/kamailio/pull/403.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/403.diff'>https://github.com/kamailio/kamailio/pull/403.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/403">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZazS1GkHCd1lGRKHxRh94XpgzKvjks5pHaWzgaJpZM4GldGr.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/403"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>