[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-users
Subject:    Re: [asterisk-users] Which tool to automatically restart Asterisk ?
From:       Tahir Almas <tahir () ictinnovations ! com>
Date:       2017-02-28 4:12:45
Message-ID: CAOL0t+Kzm=eW9ihZpwYbayHLbG7+tTdqa_0_6agCpee9ozTsLw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks for your  suggestions

*Tahir Almas*

Managing Partner
ICT Innovations
http://www.ictinnovations.com
http://www.ictbroadcast.com

On Mon, Feb 27, 2017 at 6:38 AM, Tzafrir Cohen <tzafrir.cohen@xorcom.com>
wrote:

> On Mon, Feb 27, 2017 at 06:00:30PM +0500, Tahir Almas wrote:
> > Sorry  ,  I  forget  it  for another monitoring tool  monit  that we have
> > used  in  our production systems  to restart  asterisk  in case of
> asterisk
> > crash or  halt.
>
> [snip]
>
> Some notes regarding the asterisk monit configuration:
>
> > check process asterisk with pidfile /var/run/asterisk/asterisk.pid
> >     group asterisk
> >     start program = "/bin/bash -c 'ulimit -n 16386 &&
> /etc/init.d/asterisk start'"
>
> If you use systemd, this ulimit will have no effect: when you restart a
> service, it is restarted from a separate systemd context (cgroup) and
> not directly under your own.
>
> It would generalyl be a good idea not to embed such settings in your
> scripts and rather put them in a proper configuration file. What happens
> in you happen to run '/etc/init.d/asterisk restart'? It seems that all's
> well, until you're suddenly out of file descriptors.
>
> >     stop program = "/etc/init.d/asterisk stop"
> >     if does not exist for 2 cycles then restart
> >     if failed port 5060 type udp protocol SIP
> >         and target "011@127.0.0.1" maxforward 10
> >         for 2 cycles then restart
> >     if failed host 127.0.0.1 port 5038 with timeout 15 seconds for 2
> cycles then restart
> >     if 5 restarts within 5 cycles then timeout
>
> Nice.
>
> Also: what happens when you run 'core stop now' from within asterisk?
>
> --
>                Tzafrir Cohen
> icq#16849755              jabber:tzafrir.cohen@xorcom.com
> +972-50-7952406           mailto:tzafrir.cohen@xorcom.com
> http://www.xorcom.com
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>

[Attachment #5 (text/html)]

<div dir="ltr">Thanks for your   suggestions   <div class="gmail_extra"><br \
clear="all"><div><div class="gmail_signature"><b>Tahir Almas</b><br><br>Managing \
Partner<br>ICT Innovations<br><a href="http://www.ictinnovations.com" \
target="_blank">http://www.ictinnovations.com</a></div><div \
class="gmail_signature"><div><div class="gmail_signature"><a \
href="http://www.ictbroadcast.com">http://www.ictbroadcast.com</a></div></div><div><br></div><div>On \
Mon, Feb 27, 2017 at 6:38 AM, Tzafrir Cohen <span dir="ltr">&lt;<a \
href="mailto:tzafrir.cohen@xorcom.com" \
target="_blank">tzafrir.cohen@xorcom.com</a>&gt;</span> \
wrote:<br></div></div></div><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Mon, Feb 27, 2017 at \
06:00:30PM +0500, Tahir Almas wrote:<br> &gt; Sorry   ,   I   forget   it   for \
another monitoring tool   monit   that we have<br> &gt; used   in   our production \
systems   to restart   asterisk   in case of asterisk<br> &gt; crash or   halt.<br>
<br>
</span>[snip]<br>
<br>
Some notes regarding the asterisk monit configuration:<br>
<br>
&gt; check process asterisk with pidfile /var/run/asterisk/asterisk.pid<br>
&gt;        group asterisk<br>
&gt;        start program = &quot;/bin/bash -c &#39;ulimit -n 16386 &amp;&amp; \
/etc/init.d/asterisk start&#39;&quot;<br> <br>
If you use systemd, this ulimit will have no effect: when you restart a<br>
service, it is restarted from a separate systemd context (cgroup) and<br>
not directly under your own.<br>
<br>
It would generalyl be a good idea not to embed such settings in your<br>
scripts and rather put them in a proper configuration file. What happens<br>
in you happen to run &#39;/etc/init.d/asterisk restart&#39;? It seems that \
all&#39;s<br> well, until you&#39;re suddenly out of file descriptors.<br>
<br>
&gt;        stop program = &quot;/etc/init.d/asterisk stop&quot;<br>
&gt;        if does not exist for 2 cycles then restart<br>
&gt;        if failed port 5060 type udp protocol SIP<br>
&gt;              and target &quot;<a \
href="mailto:011@127.0.0.1">011@127.0.0.1</a>&quot; maxforward 10<br> &gt;            \
for 2 cycles then restart<br> &gt;        if failed host 127.0.0.1 port 5038 with \
timeout 15 seconds for 2 cycles then restart<br> &gt;        if 5 restarts within 5 \
cycles then timeout<br> <br>
Nice.<br>
<br>
Also: what happens when you run &#39;core stop now&#39; from within asterisk?<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
--<br>
                       Tzafrir Cohen<br>
icq#16849755                     <a \
href="mailto:jabber%3Atzafrir.cohen@xorcom.com">jabber:tzafrir.cohen@xorcom.<wbr>com</a><br>
 <a href="tel:%2B972-50-7952406" value="+972507952406">+972-50-7952406</a>            \
mailto:<a href="mailto:tzafrir.cohen@xorcom.com">tzafrir.cohen@xorcom.<wbr>com</a><br>
 <a href="http://www.xorcom.com" rel="noreferrer" \
target="_blank">http://www.xorcom.com</a><br> <br>
--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" \
rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br> <br>
Check out the new Asterisk community forum at: <a \
href="https://community.asterisk.org/" rel="noreferrer" \
target="_blank">https://community.asterisk.<wbr>org/</a><br> <br>
New to Asterisk? Start here:<br>
         <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" \
rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
 <br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
     <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" \
rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br>
 </div></div></blockquote></div><br></div></div>



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic