Summary:ASTERISK-13641: [patch] #exec lines causing failure of parsing of extensions.conf
Reporter:John Todd (jtodd)Labels:
Date Opened:2009-02-24 13:47:44.000-0600Date Closed:2009-09-02 13:53:43
Versions:Frequency of
Environment:Attachments:( 0) 20090901__issue14542.diff.txt
( 1) exec-broken.txt
Description:If I add an #exec line with a script to my extensions.conf, Asterisk locks up when it tries to parse that line and include the data from the script.

I've included a scripted capture of the #exec'ed file, the output, and the fact that I have to kill Asterisk with "-9" to get it to die.

Comments:By: John Todd (jtodd) 2009-02-24 13:49:23.000-0600

Worth mentioning: this is on MacOS 10.5.6, and the other configurations of Asterisk in that directory are completely stock, meaning with the exception of adding the #exec line on extensions.conf, and enabling execs in asterisk.conf, there have been NO changes to the config files from what was delivered in SVN.

By: John Todd (jtodd) 2009-02-24 13:50:33.000-0600

Also worth mentioning (forgot to include it in the script):

sh-3.2# dir /tmp/touchme.sh
8 -rwxr-xr-x  1 root  wheel  79 Feb 24 13:35 /tmp/touchme.sh

By: John Todd (jtodd) 2009-02-24 13:56:21.000-0600

Also worth mentioning:

I tried this, but same results:

#exec "/tmp/touchme.sh"

I also then tried this invalid test:

#exec blah

...and the results still were the same.  So this may not have anything to do with the output of the script itself, but may be some deeper inherent problem with either my incantation of the method or with the #exec code.

By: Tilghman Lesher (tilghman) 2009-02-24 16:19:54.000-0600

This may be OS X specific.  I just tried this on Linux and it worked fine.

By: Leif Madsen (lmadsen) 2009-05-20 09:12:35

Could the poll() changes that recently went in affected this at all? Perhaps this is no longer an issue?

By: Tilghman Lesher (tilghman) 2009-08-28 10:16:08

jtodd: ping

By: John Todd (jtodd) 2009-08-28 10:22:27

Well, I'd test it if I could get * to compile on MacOS, but that's another bug.

By: Tilghman Lesher (tilghman) 2009-08-30 13:40:28

I have modified trunk to build on Mac OS X.  Please be advised that you need to export the environmental variable MACOSX_DEPLOYMENT_TARGET=10.2 to get Asterisk to build correctly.  I'm still working out how to get this set for the linker.

Please verify whether this issue still exists.

By: John Todd (jtodd) 2009-08-30 15:41:21

I can now compile Asterisk on MacOS with that flag.

However, I get the same symptoms with the newest version of TRUNK, with exactly the same configuration as described.  Also, for reference since I didn't say it earlier, the #exec'ed file is:

8 -rwxrwxrwx   1 root   wheel    46 Aug 30 16:36 touchme.sh

By: Tilghman Lesher (tilghman) 2009-09-01 12:05:11

On the system I'm testing, it doesn't seem to matter whether or not there is an '#exec' in a config file.  The startup daemon does not give a prompt at all (though if you connect with 'asterisk -rc', it works fine).

By: John Todd (jtodd) 2009-09-01 12:35:13

I'm trying with "asterisk -vvvvgcd" as a standalone startup, which causes a lock.  Still a problem here.

Removing the "#exec" line from extensions.conf results in Asterisk executing completely and successfully with the same command.

By: Tilghman Lesher (tilghman) 2009-09-01 12:57:10

Found it.  It wasn't actually breaking, just taking an exceedingly long time to complete.

By: Tilghman Lesher (tilghman) 2009-09-02 09:52:12

What's more important is that this problem would have occurred ANY time that Asterisk forked a child process, including AGI, System application, etc.

By: John Todd (jtodd) 2009-09-02 10:20:26

With latest version of TRUNK from about 10m ago, I get the same symptoms on MacOS - the #exec line causes the parsing of the extensions.conf file to hang.

By: Tilghman Lesher (tilghman) 2009-09-02 10:31:30

jtodd:  as with other reporters, we post patches here prior to committing them, so that the reporter may verify that the patch fixes the issue.

By: John Todd (jtodd) 2009-09-02 10:54:35

Whoops - interpreted things as you updating TRUNK.  Didn't see the patch.  Testing now.  Patched.  make clean;make;make install.   Test.  Same results.  :-(

By: Tilghman Lesher (tilghman) 2009-09-02 11:39:45

Weird, what are your values for 'ulimit -n' on your shell command line?

By: John Todd (jtodd) 2009-09-02 11:50:20

sh-3.2# ulimit -n

By: Tilghman Lesher (tilghman) 2009-09-02 12:35:16

Well, to continue, I need access to a 10.5 box.  The patch, as it exists now, works fine on 10.4.

By: Tilghman Lesher (tilghman) 2009-09-02 12:37:50

One more thing to check:  previous versions of Asterisk on OS X installed into /usr/sbin/asterisk, whereas current versions are installed into /usr/local/sbin/asterisk.  It's therefore important to check that you do not have 2 different binaries on your system and that you're running the current version.  (Also, config files are sourced from /usr/local/etc/asterisk.)

By: John Todd (jtodd) 2009-09-02 12:54:33

I was using the wrong binary, you're right.  I deleted the old installation(s).

Works with the patch on 10.5.  Thanks!

By: Digium Subversion (svnbot) 2009-09-02 13:38:10

Repository: asterisk
Revision: 215567

U   trunk/main/Makefile
U   trunk/main/app.c

r215567 | tilghman | 2009-09-02 13:38:10 -0500 (Wed, 02 Sep 2009) | 9 lines

Close up to the soft open file limit (same on Linux, but varies drastically on OS X).
Also, a Makefile fix for Darwin (OS X).
(closes issue ASTERISK-13641)
Reported by: jtodd
      20090901__issue14542.diff.txt uploaded by tilghman (license 14)
Tested by: jtodd, tilghman
Change-type: bugfix



By: Digium Subversion (svnbot) 2009-09-02 13:53:43

Repository: asterisk
Revision: 215570

_U  branches/1.6.2/
U   branches/1.6.2/main/Makefile
U   branches/1.6.2/main/app.c

r215570 | tilghman | 2009-09-02 13:53:43 -0500 (Wed, 02 Sep 2009) | 16 lines

Merged revisions 215567 via svnmerge from

 r215567 | tilghman | 2009-09-02 13:37:25 -0500 (Wed, 02 Sep 2009) | 9 lines
 Close up to the soft open file limit (same on Linux, but varies drastically on OS X).
 Also, a Makefile fix for Darwin (OS X).
 (closes issue ASTERISK-13641)
  Reported by: jtodd
        20090901__issue14542.diff.txt uploaded by tilghman (license 14)
  Tested by: jtodd, tilghman
  Change-type: bugfix