RE: [Asterisk-Users] Check and restart script..

2003-09-26 Thread Adams, Gavin
-Original Message- From: Garry Adkins [mailto:[EMAIL PROTECTED] I agree... As a unix support person at work, I find that I have to write these types of watchdogs often... Sometimes an application will partially fail, or fail but not exit, ending up as some zombie. (I've tried the

Re: [Asterisk-Users] Check and restart script..

2003-09-25 Thread Andrew Kohlsmith
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..

Re: [Asterisk-Users] Check and restart script..

2003-09-25 Thread Andrew Kohlsmith
I'm assuming you are doing something like ps axuwww|grep asterisk If you use a character class on the command line, the command line won't show up, but what your searching for will, ie. ps axuwww|grep [a]sterisk That, and any reason to make ps to all that extra work? ps x | grep

Re: [Asterisk-Users] Check and restart script..

2003-09-25 Thread Garry Adkins
I still feel that some kind of heartbeat check on asterisk itself would be best... Does anything like that exist now? Something that an external process can check with asterisk and verify that all FXS/FXO/IAX2?/SIP/H323 processess are running normally? I agree... As a unix support person

Re: [Asterisk-Users] Check and restart script..

2003-09-25 Thread Maik Schmitt
While thinking about it, you could have a single program (run from init perhaps) that: 1) Watches for the timestamp being older than x minutes 2) Generates a file to drop in the outbound directory every few minutes 3) Reads a config file on each loop so you can change the settings (i.e.

RE: [Asterisk-Users] Check and restart script..

2003-09-24 Thread Joseph Finley
You can always use the safe_asterisk script...it's in the /usr/src directory. That's what I use. Joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of WipeOut . Sent: Wednesday, September 24, 2003 11:02 AM To: [EMAIL PROTECTED] Subject: [Asterisk-Users]

RE: [Asterisk-Users] Check and restart script..

2003-09-24 Thread Skuse, Phil
Could you not just add it to your /etc/inittab? -Original Message- From: WipeOut . [mailto:[EMAIL PROTECTED] Sent: 24 September 2003 16:02 To: [EMAIL PROTECTED] Subject: [Asterisk-Users] Check and restart script.. Has anyone written a script that can be used as a cron job or similar

RE: [Asterisk-Users] Check and restart script..

2003-09-24 Thread Scott Stingel
Something like this can tell if asterisk is running. You can modify it as needed. Doesn't match the ps: if [ A`ps -e | grep asterisk | grep -v grep` = A ]; then echo echo It's not running echo else echo echo It's running echo fi Scott M. Stingel Emerging Voice Technology Inc. Email:

Re: [Asterisk-Users] Check and restart script..

2003-09-24 Thread Steven Critchfield
On Wed, 2003-09-24 at 10:01, 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

Re: [Asterisk-Users] Check and restart script..

2003-09-24 Thread Cristian Vasiliu
3 ways: 1. in /etc/inittab : d1:23:respawn:/usr/sbin/asterisk -fv 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

Re: [Asterisk-Users] Check and restart script..

2003-09-24 Thread WipeOut .
Maybe you should look at init. From the init man page... When starting a new process, init first checks whether the file /etc/initscript exists. If it does, it uses this script to start the process. Each time a child terminates, init records the fact

Re: [Asterisk-Users] Check and restart script..

2003-09-24 Thread Steven Critchfield
On Wed, 2003-09-24 at 11:57, WipeOut . wrote: Maybe you should look at init. From the init man page... When starting a new process, init first checks whether the file /etc/initscript exists. If it does, it uses this script to start the process.

RE: [Asterisk-Users] Check and restart script..

2003-09-24 Thread Uriel Carrasquilla
yes, it is not cron but a daemon. Iactually got the suggestion from this list. You can get all the glory details from: http://cr.yp.to/daemontools.html Dr. Bernstein tools. I have been using it with asterisk successfully for 4 months. Regards, Uriel -Original Message- From: [EMAIL