Bug#362281: Stop now

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon May 29 19:43:10 UTC 2006


On Mon, May 29, 2006 at 05:44:16PM +0200, Johan Thelmén wrote:
> 
> $REALDAEMON is stripping the '  so it only get the command stop
> 
> Tried to replace $CLIARGS in safe_asterisk with $* but then it exited 
# with code 1 and restarted and restarted..
> I probably missed something.
> 
> /etc/init.d/asterisk
>   stop)
>         echo -n "Stopping $DESC: "
> #       if [ "$RUNASTSAFE" = "yes" ];then
> #               # hopefully this will work. Untested
> #               $REALDAEMON -rx 'stop now' > /dev/null  || true
> #       else
>                 # Try gracefully.
>                 # this may hang in some cases. Specifically, when the asterisk
>                 # processes is stopped. No bother to worry about cleanup:
>                 # it will either fail or die when asterisk dies.
>                 ( $DAEMON -rx 'stop now' > /dev/null 2>&1 & ) &
> #       fi

Could you please instead try applying the attached patch to safe_asterisk?
(Basically: replace CLIARGS with a plain "$@")

-- 
Tzafrir Cohen      sip:tzafrir at local.xorcom.com
icq#16849755       iax:tzafrir at local.xorcom.com
+972-50-7952406           
tzafrir.cohen at xorcom.com  http://www.xorcom.com
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## safe_asterisk_cli_params.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad asterisk-1.2.7.1.dfsg/contrib/scripts/safe_asterisk /tmp/dpep.FwQLCo/asterisk-1.2.7.1.dfsg/contrib/scripts/safe_asterisk
--- asterisk-1.2.7.1.dfsg/contrib/scripts/safe_asterisk	2005-11-29 20:24:39.000000000 +0200
+++ /tmp/dpep.FwQLCo/asterisk-1.2.7.1.dfsg/contrib/scripts/safe_asterisk	2006-05-29 22:39:38.318645231 +0300
@@ -1,5 +1,4 @@
 #!/bin/sh
-CLIARGS="$*"		# Grab any args passed to safe_asterisk
 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
@@ -45,10 +44,10 @@
 		if [ "$TTY" != "" ]; then
 			cd /tmp
 			stty sane < /dev/${TTY}
-			${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
+			${ASTSBINDIR}/asterisk "$@" ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
 		else
 			cd /tmp
-			${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
+			${ASTSBINDIR}/asterisk "$@" ${ASTARGS}
 		fi
 		EXITSTATUS=$?
 		echo "Asterisk ended with exit status $EXITSTATUS"


More information about the Pkg-voip-maintainers mailing list