I've asterisk stop (presumably segfaulting) a couple of times, and I was just beginning to look at how to keep it running - what have others done? I was thinking of wrapping a script around asterisk like this: while 1 do asterisk -f done /Per Jessen, Z?rich -- http://www.spamchek.com/ - your spam is our business.
Tzafrir Cohen
2007-Nov-07 11:11 UTC
[asterisk-users] What do you do to keep asterisk alive?
On Wed, Nov 07, 2007 at 11:33:02AM +0100, Per Jessen wrote:> I've asterisk stop (presumably segfaulting) a couple of times, and I was > just beginning to look at how to keep it running - what have others > done? > > I was thinking of wrapping a script around asterisk like this: > > while 1-bash: 1: command not found try "true" or ':' for the smily effect :-)> do > asterisk -f > doneAnd if Asterisk decides to die? If you have a wrong module in /var/lib/asterisk/module ? You're reimplementing safe_asterisk badly. And safe_asterisk is bad enough as-is. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
Andrea Spadaccini
2007-Nov-07 11:16 UTC
[asterisk-users] What do you do to keep asterisk alive?
Ciao Per,> I've asterisk stop (presumably segfaulting) a couple of times, and I was > just beginning to look at how to keep it running - what have others > done? > > I was thinking of wrapping a script around asterisk like this: > > while 1 > do > asterisk -f > doneDoing so you won't be able to stop asterisk, if you wanted to.. IMHO it's better to build a FSM (Finite State Machine) that handles the Asterisk process and other collateral processes (like the MAPI proxy) and let it monitor the process. Moreover, you should make this FSM sensible to UNIX signals in order to start, stop, restart Asterisk easily if you want. HTH, -- Dr. Andrea Spadaccini Multimedia Technologies Institute - MTI S.r.l. Web: www.x-voice.it - Tel: +39 (0) 95 7224945
Tony Mountifield
2007-Nov-07 11:36 UTC
[asterisk-users] What do you do to keep asterisk alive?
In article <fgs48u$sd4$1 at saturn.local.net>, Per Jessen <per at computer.org> wrote:> I've asterisk stop (presumably segfaulting) a couple of times, and I wasjust beginning to > look at how to keep it running - what have othersdone? > I was thinking of wrapping a script around asterisk like this: > while 1do asterisk -fdoneHave a look at the safe_asterisk script, which should automatically be in /usr/sbin/safe_asterisk. It does this automatically, including emailing a notification (if you set the NOTIFY variable). Check the script's invocation of asterisk and make sure it includes the -f option. This in included in 1.2.19 onwards and 1.4.5 onwards. See http://bugs.digium.com/view.php?id=9121 for details if needed. Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
Per Jessen <per at computer.org> wrote: > I've asterisk stop (presumably segfaulting) a couple of times, and I was > just beginning to look at how to keep it running - what have others > done? Monit <http://www.tildeslash.com/monit/> does the job really well. It certainly isn't a replacement for fixing the root causes of whatever that makes asterisk die, though. Sajith. -- The more I want to get something done, the less I call it work. -- Richard Bach, "Illusions"
Why is it stooping on you? What version are you running? Are you running any AGI scripts? I have asterisk running for months unless I stop it manually it just doesn't die, specific system is with a quad PRI cards using 3 of them, but just one for a PRI the rest to channel banks. The other busy system that I have has 2 TDM400 cards and a dual span PRI card. All Digium cards. I have other systems - though not as busy - that run and die only when I issue stop now in the CLI or shutdown on console. On 11/7/07, Per Jessen <per at computer.org> wrote:> I've asterisk stop (presumably segfaulting) a couple of times, and I was > just beginning to look at how to keep it running - what have others > done? > > I was thinking of wrapping a script around asterisk like this: > > while 1 > do > asterisk -f > done > > > > /Per Jessen, Z?rich > > -- > http://www.spamchek.com/ - your spam is our business. > > > _______________________________________________ > --Bandwidth and Colocation Provided by http://www.api-digital.com-- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users