Basically, it's looping waiting for asterisk to disappear.
Your first command says 'shutdown when convenient'
The line in question looks to see if asterisk is still running - if it
is, it waits 5 seconds then looks again.
When it finds that asterisk is no longer running, it drops into the
'remove module' stuff.
So it's making sure that asterisk has died before zapping the modules
that asterisk needs.
HTH
Roger
Min Hwan Chang wrote:
Currently I'm using the daily reboot script for asterisk and I was
just wondering what the following line actually does:
while /bin/ps ax | /bin/grep '[s]afe_asterisk' >/dev/null; do sleep 5; done
It is from this script which I'm running through crontab:
/usr/sbin/asterisk -rx "stop when convenient"
while /bin/ps ax | /bin/grep '[s]afe_asterisk' >/dev/null; do sleep 5; done
/sbin/rmmod wctdm
/sbin/modprobe wctdm
/usr/sbin/safe_asterisk
Yes I understand that daily reboot is unnecessary but until I find the
problem, this works for our needs. I'm wondering what that line does
because last night when the Cron job started running, it kept running
the job over and over until I got an out of memory error... as seen
below:
/var/log/messages
Nov 9 04:15:32 localhost kernel: Registered tone zone 0 (United States / North$
Nov 9 04:18:00 localhost kernel: Freed a Wildcard
Nov 9 04:18:02 localhost kernel: Freshmaker version: 71
Nov 9 04:18:02 localhost kernel: Freshmaker passed register test
Nov 9 04:18:02 localhost kernel: Module 0: Installed -- AUTO FXO (FCC mode)
Nov 9 04:18:02 localhost kernel: Module 1: Installed -- AUTO FXO (FCC mode)
Nov 9 04:18:02 localhost kernel: Module 2: Installed -- AUTO FXO (FCC mode)
Nov 9 04:18:02 localhost kernel: Module 3: Installed -- AUTO FXO (FCC mode)
Nov 9 04:18:02 localhost kernel: Found a Wildcard TDM: Wildcard TDM400P REV E/$
Nov 9 04:18:02 localhost kernel: Registered tone zone 0 (United States / North$
Nov 9 07:07:12 localhost kernel: Out of Memory: Killed process 11022 (sendmail$
Nov 9 07:08:57 localhost kernel: Out of Memory: Killed process 2722 (sendmail).
Nov 9 07:09:04 localhost kernel: Out of Memory: Killed process 21792 (sendmail$
Nov 9 07:09:10 localhost kernel: Out of Memory: Killed process 24036 (sendmail$
Nov 9 07:11:00 localhost kernel: Out of Memory: Killed proc
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
--
########################################################
Roger Hill 07739 707 180
Perseverance is the hard work you do after you get
tired of doing the hard work you already did.
########################################################
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users