[Asterisk-Users] Check and restart script..

Cristian Vasiliu cvasiliu at accessnet.ro
Wed Sep 24 09:10:14 MST 2003


3 ways:
1. in /etc/inittab :
d1:23:respawn:/usr/sbin/asterisk -fvvvvv
2. use daemontools from DJB
(this is what I use)
3 safe_asterisk
(maybe is better this way) :-)

WipeOut . wrote:

>Has anyone written a script that can be used as a cron job or similar that will test if Asterisk is running and if not restart it??
>
>I have just had an issue where asterisk crashed and someone was trying to call me.. it would be nice if it could have been automatically restarted..
>
>I was thinking of a simple bash script something like running "ps -aux |grep asterisk" and then some kind of "if" to say that if the result is nothing then execute asterisk.. Problem with that theory is that the "ps" command will show up as well so i will have to work out a way to drop that..
>
>Of course I may be missing a simpler or far better solution so thats why I am asking here first..
>
>Later..
>  
>




More information about the asterisk-users mailing list