[Asterisk-Users] Graceful CLI/crontab reboot

Neil Cherry ncherry at comcast.net
Wed Oct 20 13:55:18 MST 2004


Marcelo Pacheco wrote:
> 
> Em Qua 20 Out 2004 15:14, Andrew Edmond escreveu:
> 
>>Asterisk Community --
>>
>>I'm looking for a way to gracefully shutdown asterisk at least once a
>>day and bring it back online.  I'm using Gentoo Linux and using
>>safe_asterisk from /etc/init.d/asterisk.

> #!/bin/bash
> export PATH=/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/bin:/usr/bin
> /usr/sbin/asterisk -r -x "stop when convenient"
> rmmod wcusb
> rmmod wcfxo
> rmmod zaptel
> modprobe wcusb
> modprobe wcfxo
> ztcfg -vvv
> /usr/sbin/asterisk
> 
> 
> I do exactly what you want. But I also restart 100% all of zaptel. Needed for 
> the USB FXS module.

One thing to note about Gentoo is that it doesn't like when you
stop a service any other way but the star-start scripts. Marco's
idea is a good one but use the /etc/init.d/asterisk script to
stop, clean up with the above and restart. If you do stop
asterisk with/without the start script make sure to remove the
/var/lib/init.d/started/asterisk link otherwise Gentoo won't
let you restart the asterisk script (ARGH!).

-- 
Linux Home Automation         Neil Cherry       ncherry at comcast.net
http://home.comcast.net/~ncherry/               (Text only)
http://hcs.sourceforge.net/                     (HCS II)
http://linuxha.blogspot.com/                    My HA Blog



More information about the asterisk-users mailing list