[Home]

Summary:ASTERISK-17377: asterisk -rx 'core show version' returns an ANSI string, may not evaluated correctly with various dists init.d scripts
Reporter:Alec Davis (alecdavis)Labels:
Date Opened:2011-02-09 17:12:15.000-0600Date Closed:2011-02-10 06:09:23.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:this stript fails and tries to restart asterisk, although it's already running.
Debian has been fixed and tested with ASTERISK-17373.<pre>
start)
       # Check if Asterisk is already running.  If it is, then bug out, because
       # starting up Asterisk when Asterisk is already running is very bad.
       <b>VERSION=`${DAEMON} -rx 'core show version' || ${TRUE}`</b>
       if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
               echo "Asterisk is already running.  $0 will exit now."
               exit 1
       fi
...
    # "start-stop-daemon --oknodo" returns 0 even if Asterisk was already running (as LSB
expects):
       start-stop-daemon --start --oknodo --exec $DAEMON -- $ASTARGS</pre>

****** ADDITIONAL INFORMATION ******

The fix seems to be to add the -n switch

asterisk -rnx 'core show version'

but needs testing with every distribution.

This has failed since 1.6.2.? era
Comments:By: Andrew Latham (lathama) 2011-02-10 05:56:57.000-0600

This was fixed by:

* http://svn.digium.com/view/asterisk?view=rev&revision=307314

* http://svn.digium.com/view/asterisk?view=rev&revision=307315

* http://svn.digium.com/view/asterisk?view=rev&revision=307316

How do we close tickets in Mantis?  The only related button I see is "Delete".