[Home]

Summary:ASTERISK-13066: restart gracefully / when convenient doesn't work with the AMI
Reporter:Boris Fersing (kernelsensei)Labels:
Date Opened:2008-11-13 08:29:13.000-0600Date Closed:2008-12-16 14:35:22.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Hi,

The 'restart gracefully' or 'restart when convenient' commands do not work properly when executed through the AMI. 'restart now' works well.

All the applications / fuctions are unloaded, but asterisk doesn't restart and the CLI doesn't get killed.

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

Example :

<telnet commands>

Action: Command
Command: restart gracefully

Response: Follows
Privilege: Command

</telnet commands>

<CLI output>

Waiting for inactivity to perform restart...
 == Unregistered application 'FollowMe'
 == Unregistered format g723sf
 == Unregistered channel type 'MGCP'
 == Unregistered application 'SendText'
 == Unregistered application 'NoCDR'
 == Unregistered application 'Record'
 == Unregistered 'cdr-custom' CDR backend
 == Unregistered format g729
 == Unregistered application 'Directory'
 == Unregistered application 'SayUnixTime'
 == Unregistered application 'DateTime'
 == Unregistered channel type 'Local'
 == Unregistered application 'Dial'
 == Unregistered application 'RetryDial'
 == Unregistered application 'ZapBarge'
 == Unregistered application 'Playback'
 == Unregistered application 'Zapateller'
 == Unregistered application 'LookupBlacklist'
 == Unregistered custom function BLACKLIST
 == Unregistered application 'ADSIProg'
 == Unregistered custom function TIMEOUT
 == Unregistered translator 'g726tolin' from format g726 to slin
 == Unregistered translator 'lintog726' from format slin to g726
 == Unregistered translator 'g726aal2tolin' from format g726aal2 to slin
 == Unregistered translator 'lintog726aal2' from format slin to g726aal2
 == Unregistered translator 'g726aal2tog726' from format g726aal2 to g726
 == Unregistered translator 'g726tog726aal2' from format g726 to g726aal2
 == Unregistered format mp3
 == Unregistered application 'Transfer'
 == Unregistered translator 'lintolpc10' from format slin to lpc10
 == Unregistered translator 'lpc10tolin' from format lpc10 to slin
 == Unregistered application 'ExternalIVR'
 == Unregistered application 'SpeechCreate'
 == Unregistered application 'SpeechLoadGrammar'
 == Unregistered application 'SpeechUnloadGrammar'
 == Unregistered application 'SpeechActivateGrammar'
 == Unregistered application 'SpeechDeactivateGrammar'
 == Unregistered application 'SpeechStart'
 == Unregistered application 'SpeechBackground'
 == Unregistered application 'SpeechDestroy'
 == Unregistered application 'SpeechProcessingSound'
 == Unregistered custom function SPEECH
 == Unregistered custom function SPEECH_SCORE
 == Unregistered custom function SPEECH_TEXT
 == Unregistered custom function SPEECH_GRAMMAR
 == Unregistered custom function SPEECH_ENGINE
 == Unregistered custom function SPEECH_RESULTS_TYPE
 == Unregistered translator 'lintoadpcm' from format slin to adpcm
 == Unregistered translator 'adpcmtolin' from format adpcm to slin
 == Unregistered application 'GetCPEID'
 == Unregistered application 'ZapScan'
 == Unregistered application 'ChanSpy'
 == Unregistered application 'ExtenSpy'
 == Unregistered custom function MATH
 == Unregistered custom function CDR
 == Unregistered application 'ChanIsAvail'
 == Unregistered application 'ParkAndAnnounce'
 == Unregistered custom function BASE64_ENCODE
 == Unregistered custom function BASE64_DECODE
 == Unregistered custom function RAND
 == Unregistered application 'DBdeltree'
 == Unregistered application 'DBdel'
 == Unregistered application 'Return'
 == Unregistered application 'StackPop'
 == Unregistered application 'GosubIf'
 == Unregistered application 'Gosub'
 == Unregistered application 'Milliwatt'
 == Unregistered format h263
 == Unregistered application 'SoftHangup'
 == Unregistered application 'Echo'
 == Unregistered format wav
 == Unregistered application 'WaitForRing'
 == Unregistered application 'TestClient'
 == Unregistered application 'TestServer'
 == Unregistered translator 'lintoilbc' from format slin to ilbc
 == Unregistered translator 'ilbctolin' from format ilbc to slin
 == Unregistered channel type 'Console'
 == Unregistered application 'ICES'
 == Unregistered application 'Read'
 == Unregistered channel type 'SIP'
 == Unregistered custom function SIPCHANINFO
 == Unregistered custom function SIPPEER
 == Unregistered custom function SIP_HEADER
 == Unregistered custom function CHECKSIPDOMAIN
 == Unregistered application 'SIPDtmfMode'
 == Unregistered application 'SIPAddHeader'
debossia*CLI>

</CLI output>

With 'restart now' :

<telnet commands>

Action: Command
Command: restart now

Response: Follows
Privilege: Command
Connection closed by foreign host.

</telnet commands>

<CLI output>

Beginning asterisk restart....
Executing last minute cleanups
 == Destroying musiconhold processes
Asterisk cleanly ending (0).
Preparing for Asterisk restart...
Asterisk is now restarting...
debossia*CLI>
Disconnected from Asterisk server
Executing last minute cleanups

</CLI output>
Comments:By: Leif Madsen (lmadsen) 2008-11-19 15:48:17.000-0600

Just taking a wild stab in the dark, but if you disconnect from the AMI does the system finish the restart? Wonder if there is something going on here that is causing Asterisk to not start until all AMI connections are also closed?

By: Boris Fersing (kernelsensei) 2008-11-20 02:06:15.000-0600

Hi,

no, disconnecting from the AMI doesn't help. "Action: Logoff" doesn't seem to work (no response) and closing the telnet client has no effect.

By: Leif Madsen (lmadsen) 2008-11-20 08:52:36.000-0600

I'll see if I can reproduce the issue here this afternoon.

By: Leif Madsen (lmadsen) 2008-11-20 08:53:13.000-0600

btw: you mention asterisk 1.4.18. Does this still happen with latest the latest 1.4 branch from SVN or in trunk?

By: Boris Fersing (kernelsensei) 2008-11-20 09:54:26.000-0600

Hi,

Thank you for trying to reproduce the issue. We don't have the latest SVN on our servers and no test machine to install it (at my workplace), so I can't say if the bug is still here with the latest versions.

By: Dan Julius (danj) 2008-12-05 19:23:21.000-0600

I'm using 1.4.22, I have a cron task: asterisk -rx "restart when convenient"
which runs at night.

I've noticed that often I wake up to find a running asterisk which has no modules loaded. This might be related.

By: Digium Subversion (svnbot) 2008-12-16 14:35:20.000-0600

Repository: asterisk
Revision: 164806

U   branches/1.4/main/manager.c

------------------------------------------------------------------------
r164806 | russell | 2008-12-16 14:35:20 -0600 (Tue, 16 Dec 2008) | 9 lines

Add "restart gracefully" to the AMI blacklist of CLI commands.  

"module unload" was already identified as a command that can not be used
from the AMI.  "restart gracefully" effectively unloads all modules, and will
run in to the same problems.

(closes issue ASTERISK-13066)
Reported by: kernelsensei

------------------------------------------------------------------------

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