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. Anybody have a handy CLI/crontab script that accomplishes this? Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20041020/4e74b569/attachment.htm
Wouldn't this work? Just drop this script in the cron.daily directory and modify /etc/crontab //script// #!/bin/bash asterisk -rx "restart gracefully" /etc/crontab root@pingu # cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 2 * * * root run-parts /etc/cron.daily --This tells it run scripts in the cron.daily directory at 2am 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly _____ From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Andrew Edmond Sent: Wednesday, October 20, 2004 12:15 PM To: asterisk-users@lists.digium.com Subject: [Asterisk-Users] Graceful CLI/crontab reboot 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. Anybody have a handy CLI/crontab script that accomplishes this? Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20041020/5124243b/attachment.htm
Andrew Edmond wrote:> > 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. > > Anybody have a handy CLI/crontab script that accomplishes this? > > Andrew > > > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-usersHere is my crontab command: 0 4 * * * /usr/sbin/asterisk -rx 'restart gracefully' However, there have been several occasions where the system has been "stuck" when the employees arrive for work in the morning. 'show channels' indicates a "stuck" channel on the Adtran 750, and Asterisk is unable to complete the shutdown. I need to upgrade this system to Asterisk v1.0 before I persue this problem. -- Michael Welter Introspect Telephony Corp. Denver, Colorado US +1.303.674.2575 mike@introspect.com www.introspect.com
Andrew Edmond wrote:> 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. > > Anybody have a handy CLI/crontab script that accomplishes this? > > Andrew > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-usersHow about putting this in cron, as root type crontab -e and then add the following: # reload asterisk every day at midnight exactly $00 00 * * * /etc/init.d/asterisk stop ; sleep 2 ; /etc/init.d/asterisk start -- Linux Home Automation Neil Cherry ncherry@comcast.net http://home.comcast.net/~ncherry/ (Text only) http://hcs.sourceforge.net/ (HCS II) http://linuxha.blogspot.com/ My HA Blog
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. > > Anybody have a handy CLI/crontab script that accomplishes this? > > Andrew#!/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. I'm using this essentially in production in my business partner's home office without problems for almost 2 months now. Marcelo Pacheco