[Home]

Summary:ASTERISK-14669: [patch] manager keeps creating /tmp/ast-ami-XXXXXX files (without deleting) when a single manager client remains logged in
Reporter:Zahid Mehmood (zmehmood)Labels:
Date Opened:2009-08-17 16:27:00Date Closed:2009-08-18 11:41:49
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) M15730.diff
Description:Using web-meetme to manage conferences on asterisk. Web-meetme's cbEnd.php script logs in to the manager interface to receive event notifications.  cbEnd.php remains logged in and during this time /tmp is getting filled up.  There are 4-6 /tmp/ast-ami-xxxx files bing created every minute.

exiting the cbEnd.php script does not remove these /tmp/files neither does restarting asterisk.  

Same error when using 1.4.26

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

Same script was working fine with 1.4.18 version.  Upgraded to 1.4.26 and noticed this problem.  

lsof shows all files still being used by asterisk

asterisk  18241    root   25u      REG      104,3          0         29 /tmp/ast-ami-80RkqE
asterisk  18241    root   27u      REG      104,3          0         25 /tmp/ast-ami-dydAjU
asterisk  18241    root   28u      REG      104,3          0         26 /tmp/ast-ami-8mxpJr
asterisk  18241    root   29u      REG      104,3          0         30 /tmp/ast-ami-pt76sf
asterisk  18241    root   30u      REG      104,3          0         31 /tmp/ast-ami-3Vb4U6
asterisk  18241    root   31u      REG      104,3          0         32 /tmp/ast-ami-Uw9eMe
asterisk  18241    root   32u      REG      104,3          0         33 /tmp/ast-ami-nMND2C
asterisk  18241    root   33u      REG      104,3          0         34 /tmp/ast-ami-kqBgIh
asterisk  18241    root   34u      REG      104,3          0         35 /tmp/ast-ami-sil7Mc
asterisk  18241    root   35u      REG      104,3          0         36 /tmp/ast-ami-kSJbho
Comments:By: Clod Patry (junky) 2009-08-17 22:22:17

With 1.4.26.1, if you do an invalid Action: Command, that will leave ast-ami-* files.

just do this after your AMI is connected:

Action: Command

Response: Error
Message: No command provided

Each time that invalid Command is done, an extra ast-ami-XXXXXX.

Same behavior will happen if you have blacklisted commands.

By: Clod Patry (junky) 2009-08-17 22:22:59

give this patch a try.

By: Zahid Mehmood (zmehmood) 2009-08-18 08:03:35

Thank you very much for such a quick response.  

The patch seems to be working fine.  No more /tmp/ast-ami-xxxx files.

By: Digium Subversion (svnbot) 2009-08-18 11:36:30

Repository: asterisk
Revision: 212763

U   branches/1.4/main/manager.c

------------------------------------------------------------------------
r212763 | seanbright | 2009-08-18 11:36:30 -0500 (Tue, 18 Aug 2009) | 11 lines

Delay the creation of temporary files until we have a valid manager command to handle.

Without this patch, asterisk creates a temporary file before determining if the
specified command is valid.  If invalid, we weren't properly cleaning up the file.

(closes issue ASTERISK-14669)
Reported by: zmehmood
Patches:
     M15730.diff uploaded by junky (license 177)
Tested by: zmehmood

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

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

By: Digium Subversion (svnbot) 2009-08-18 11:39:06

Repository: asterisk
Revision: 212764

_U  trunk/
U   trunk/main/manager.c

------------------------------------------------------------------------
r212764 | seanbright | 2009-08-18 11:39:06 -0500 (Tue, 18 Aug 2009) | 18 lines

Merged revisions 212763 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r212763 | seanbright | 2009-08-18 12:36:00 -0400 (Tue, 18 Aug 2009) | 11 lines
 
 Delay the creation of temporary files until we have a valid manager command to handle.
 
 Without this patch, asterisk creates a temporary file before determining if the
 specified command is valid.  If invalid, we weren't properly cleaning up the file.
 
 (closes issue ASTERISK-14669)
 Reported by: zmehmood
 Patches:
       M15730.diff uploaded by junky (license 177)
 Tested by: zmehmood
........

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

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

By: Digium Subversion (svnbot) 2009-08-18 11:41:45

Repository: asterisk
Revision: 212766

_U  branches/1.6.1/
U   branches/1.6.1/main/manager.c

------------------------------------------------------------------------
r212766 | seanbright | 2009-08-18 11:41:44 -0500 (Tue, 18 Aug 2009) | 25 lines

Merged revisions 212764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r212764 | seanbright | 2009-08-18 12:38:36 -0400 (Tue, 18 Aug 2009) | 18 lines
 
 Merged revisions 212763 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r212763 | seanbright | 2009-08-18 12:36:00 -0400 (Tue, 18 Aug 2009) | 11 lines
   
   Delay the creation of temporary files until we have a valid manager command to handle.
   
   Without this patch, asterisk creates a temporary file before determining if the
   specified command is valid.  If invalid, we weren't properly cleaning up the file.
   
   (closes issue ASTERISK-14669)
   Reported by: zmehmood
   Patches:
         M15730.diff uploaded by junky (license 177)
   Tested by: zmehmood
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-08-18 11:41:48

Repository: asterisk
Revision: 212767

_U  branches/1.6.2/
U   branches/1.6.2/main/manager.c

------------------------------------------------------------------------
r212767 | seanbright | 2009-08-18 11:41:48 -0500 (Tue, 18 Aug 2009) | 25 lines

Merged revisions 212764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r212764 | seanbright | 2009-08-18 12:38:36 -0400 (Tue, 18 Aug 2009) | 18 lines
 
 Merged revisions 212763 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r212763 | seanbright | 2009-08-18 12:36:00 -0400 (Tue, 18 Aug 2009) | 11 lines
   
   Delay the creation of temporary files until we have a valid manager command to handle.
   
   Without this patch, asterisk creates a temporary file before determining if the
   specified command is valid.  If invalid, we weren't properly cleaning up the file.
   
   (closes issue ASTERISK-14669)
   Reported by: zmehmood
   Patches:
         M15730.diff uploaded by junky (license 177)
   Tested by: zmehmood
 ........
................

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

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