Page 1 of 1

asterisk -rx "restart now"

PostPosted: Sun Jun 20, 2010 4:35 pm
by bmorrison
Asterisk flipped out (using 200% of CPU when idle) and I wanted to restart it. However, asterisk -rx "restart now" did nothing. Neither did "stop now".

I simply rebooted the box and everything went back to normal, but I've been searching the forums here since for the proper way to restart asterisk on a vicibox install without a full shutdown -r. I have been unable to find a post.

I tried "service vicidial restart" but I just managed to break everything.

I was going to install monit on this box to automatically restart asterisk if it flipped out again, but if -rx restart now isn't an option I'm not sure how to get a watchdog on the process.

PostPosted: Sun Jun 20, 2010 7:35 pm
by Acidshock
Not sure if this is your problem but try running:
/etc/init.d/vicidial restart

PostPosted: Sun Jun 20, 2010 7:58 pm
by bmorrison
Thanks for the reply.

I did try that, however it just broke all kinds of stuff. One of the screens died (I think) and I had to reboot the box.

PostPosted: Sun Sep 26, 2010 3:59 pm
by x-rateddissiden
I have the same problem. Any other solution?

PostPosted: Fri Oct 01, 2010 12:25 am
by Kumba
If asterisk deadlocks, I.E. stops responding to anything, you have to do a manual stop. Here's how you do it:

1) Type ps ax | grep asterisk | grep -v grep
2) The first number in the output is the PID process. The one we are interested in here is the line that has /usr/sbin/asterisk on it. Type kill -9 <pid-number>
3) Type 'screen -ls'.You are interested in the number preceeding the period on two lines. One line contains the word 'astshell', the second line contains the work 'asterisk'.
4) Type kill -9 <pid-of-astshell> <pid-of-asterisk>
5) Type 'screen -wipe'
6) Type '/etc/init.d/vicidial stop'
7) Type '/etc/init.d/vicidial start'

And you have just fixed a crashed asterisk process without restarting the server. And now you also know why we tell people to just reboot the server most of the time. If you are running a newer version of vicibox (v.3.0+), you can omit steps 3, 4 and 5. The init script in these versions will automatically kill the screen processes when stop is issued.