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:[EMAIL PROTECTED]
icq#16849755       iax:[EMAIL PROTECTED]
+972-50-7952406           
[EMAIL PROTECTED]  http://www.xorcom.com
#! /bin/sh /usr/share/dpatch/dpatch-run
## safe_asterisk_cli_params.dpatch by Tzafrir Cohen <[EMAIL PROTECTED]>
##
## 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
 [EMAIL PROTECTED]      # 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"

Reply via email to