[asterisk-bugs] [AsteriskNOW and Packages 0017461]: Amportal Restart fails to wait till Asterisk stops

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Jun 13 13:31:35 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17461 
====================================================================== 
Reported By:                vmikhelson
Assigned To:                
====================================================================== 
Project:                    AsteriskNOW and Packages
Issue ID:                   17461
Category:                   New Feature
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
JIRA:                        
====================================================================== 
Date Submitted:             2010-06-03 21:39 CDT
Last Modified:              2010-06-13 13:31 CDT
====================================================================== 
Summary:                    Amportal Restart fails to wait till Asterisk stops
Description: 
Freepbx_engine logic assumes that Asterisk stops immediately upon 'core
stop gracefully' command execution. This behavior changed in Asterisk
1.6.2. It takes its time to perform a lot of cleanup.

One solution is to use 'core stop now'

Another solution is to implement a 'while' loop.

Modified stop_asterisk() function with the 'while' loop is in Additional
Information.
====================================================================== 

---------------------------------------------------------------------- 
 (0123330) vmikhelson (reporter) - 2010-06-13 13:31
 https://issues.asterisk.org/view.php?id=17461#c123330 
---------------------------------------------------------------------- 
--- ../freepbx_engine   2010-01-24 04:19:27.000000000 -0600
+++ freepbx_engine      2010-06-03 21:41:14.000000000 -0500
@@ -164,6 +164,15 @@
                then
                        /usr/sbin/asterisk -rx "core stop gracefully" |
grep -v "No such command"
                        /usr/sbin/asterisk -rx "stop gracefully" | grep -v
-E "No such command|deprecated"
+                       echo "Waiting for Asterisk to Stop"
+                       while :
+                       do
+                           pid_length=`$PIDOF asterisk|awk '{print
length($0)}'`
+                           if [ "$pid_length" = "0" -o "$pid_length" = ""
]
+                               then
+                                   break
+                               fi
+                       done
                        echo "Asterisk Stopped"
                fi
 } 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-13 13:31 vmikhelson     Note Added: 0123330                          
======================================================================




More information about the asterisk-bugs mailing list