From: Tilghman Lesher Date: Mon, 2 Nov 2009 17:14:20 +0000 (+0000) Subject: Don't allow two separate instances of safe_asterisk when restarting from the init... X-Git-Tag: 1.4.27-rc3~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=717c3e17892c1c22062346db518e4626c4f05fd3;p=thirdparty%2Fasterisk.git Don't allow two separate instances of safe_asterisk when restarting from the init script. (closes issue #14562) Reported by: davidw Patches: Initially 20091022__issue14562.diff.txt uploaded by tilghman (license 14) Modified to 20091030__Issue14562_diff.txt uploaded by davidw (license 780) Tested by: davidw git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@226811 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/contrib/init.d/rc.redhat.asterisk b/contrib/init.d/rc.redhat.asterisk index d2a630ea40..f2ebc3674d 100755 --- a/contrib/init.d/rc.redhat.asterisk +++ b/contrib/init.d/rc.redhat.asterisk @@ -99,8 +99,14 @@ start() { stop() { # Stop daemons. + if [ -f $SAFE_ASTERISK ]; then + # Kill safe_asterisk first, to prevent us from starting up 2 instances of safe_asterisk + echo -n $"Stopping safe_asterisk: " + killproc `basename $SAFE_ASTERISK` + echo + fi echo -n $"Shutting down asterisk: " - killproc asterisk + killproc `basename $DAEMON` RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/asterisk echo