[svn-commits] russell: trunk r39636 - /trunk/contrib/scripts/safe_asterisk

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Aug 13 18:13:32 MST 2006


Author: russell
Date: Sun Aug 13 20:13:32 2006
New Revision: 39636

URL: http://svn.digium.com/view/asterisk?rev=39636&view=rev
Log:
add the ability to run an arbitrary command if asterisk crashes
(inspired by issue #7698, which was res_segfault by anthm)

Modified:
    trunk/contrib/scripts/safe_asterisk

Modified: trunk/contrib/scripts/safe_asterisk
URL: http://svn.digium.com/view/asterisk/trunk/contrib/scripts/safe_asterisk?rev=39636&r1=39635&r2=39636&view=diff
==============================================================================
--- trunk/contrib/scripts/safe_asterisk (original)
+++ trunk/contrib/scripts/safe_asterisk Sun Aug 13 20:13:32 2006
@@ -5,6 +5,7 @@
 TTY=9						# TTY (if you want one) for Asterisk to run on
 CONSOLE=yes					# Whether or not you want a console
 #NOTIFY=ben at alkaloid.net	# Who to notify about crashes
+#EXEC=/path/to/somescript	# Run this command if Asterisk crashes
 MACHINE=`hostname`			# To specify which machine has crashed when getting the mail
 DUMPDROP=/tmp
 SLEEPSECS=4
@@ -131,6 +132,9 @@
 				echo "Asterisk on $MACHINE exited on signal $EXITSIGNAL.  Might want to take a peek." | \
 				mail -s "Asterisk Died" $NOTIFY
 			fi
+			if [ "$EXEC" != "" ]; then
+				$EXEC
+			fi
 			if [ -f /tmp/core ]; then
 				mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
 			fi



More information about the svn-commits mailing list