[asterisk-users] Starting Asterisk on Ubuntu 7.04

Remco Post remco at pipsworld.nl
Sat May 5 10:42:06 MST 2007


Tzafrir Cohen wrote:
> On Sat, May 05, 2007 at 06:23:43PM +0200, Remco Post wrote:
>> Mark Coccimiglio wrote:
>>> Tzafrir;
>>>    Actually I have found this config to work really well.  I prefer to
>>> use a script run from inittab but Ubuntu doesn't work like Redhat or
>>> BSD.  On a production box keeping asterisk up and running is "THE TOP"
>>> priority.  If you would rather check every five minutes then replace the
>>> first "*" with "*/5".  I will address your points as it seems that you
>>> haven't really thought about this.
>>>
>>> 1)  In a production environment you should NOT be messing with the
>>> config.  That's what test hardware is for.
>>>
>>> 2) The answer to this question is: "crontab -e" its really not that
>>> hard.  I'm not running asterisk every minute.  I'm looking to see if
>>> asterisk is running and then act accordingly
>>>
>>> 3) If asterisk fails believe me a full mailbox is the least of my
>>> worries.  As for full logs I'd rather have more information...."grep &
>>> awk" are your friends.
>>>
>>> I prefer to keep things as simple as possible.  Sure scripts like
>>> "safe_asterisk" are nice and do some
>>> really neat things but lets face it how often do you actually sit at the
>>> console of your asterisk box.  My
>>> main PBX is located about 7 feet from my office desk and I still mostly
>>> use ssh (not even telnet) to get
>>> into the box.
>> at least on ubuntu 6.10 safe_asterisk requires one simple fix, not
>> really a headbreaker (something with output redirection). 
> 
> Bashism? 
> 
> The rule in Debian is that a bourne shell script (#!/bin/sh) should not
> use bash-specific features, such as &> . If it does, it should
> explicitly ask for bash: '#!/bin/bash'
> 

hmmm, you might have a point there, never thought of that.

>> You could
>> actually edit the script to not start a console if you dont' want it to
>> (say for security reasons).
> 
> Could you please elaborate?
> 

Change:

CONSOLE=yes                                     # Whether or not you
want a console

To 'CONSOLE=no'

> I believe that this would wreck the error handling in that script.
> 
>> If you wanted to start asterisk and keep monitoring it, that is what
>> init is for. I don't know about ubuntu startup, but traditional sysV
>> init would simply restart a process if it ever quits (respawn). My bet
>> is that startup can do the same somehow, this is a far better way to
>> keep * up....
> 
> But this means editing /etc/inittab every time you actually want to stop
> asterisk.
> 

Or change runlevel... well that is maybe a bit to much AIX :)

-- 

Remco Post

"I didn't write all this code, and I can't even pretend that all of it
makes sense." -- Glen Hattrup


More information about the asterisk-users mailing list