Summary:ASTERISK-02255: Makefile has hardcoded paths, should always use paths in /etc/asterisk/asterisk.conf
Reporter:ltropiano (ltropiano)Labels:
Date Opened:2004-08-22 14:48:12Date Closed:2008-01-15 15:05:58.000-0600
Versions:Frequency of
Description:If you want to place Asterisk elsewhere, you have to recompile.  It would be best if it utilized the paths and configuration at runtime in /etc/asterisk/asterisk.conf.

I wanted ot have two copies of asterisk running binding to difference addresses and having different configs (tried to use the asterisk -C ...) but with the hardcoded compiled in "Makefile" paths the 2nd copy fails...
Comments:By: Mark Spencer (markster) 2004-08-22 14:59:20

What paths aren't being pulled from asterisk.conf?  I think they all are...

By: ltropiano (ltropiano) 2004-08-22 15:25:33

Well for one, /var/run...

# asterisk -C asterisk.conf
Asterisk already running on /var/run/asterisk.ctl.  Use 'asterisk -r' to connect.
# grep run asterisk.conf
astrundir => /var/tmp
# ls /var/run/asterisk.ctl
# ls /var/tmp/asterisk.ctl
ls: /var/tmp/asterisk.ctl: No such file or directory

There might be others...

By: ltropiano (ltropiano) 2004-08-24 21:32:41

Any further thoughts on this?

By: Mark Spencer (markster) 2004-08-25 00:42:54

I've looked at the code and clearly the code suggests that it doesn't behave the way you're suggesting.  I've asked someone else to try to duplicate it, but nobody has so far.

Are you sure you've tried recent CVS?

By: brc007 (brc007) 2004-08-26 05:47:45

I just tried this and got the exact same results as Itropiano.

However, if I started asterisk without the -C asterisk.conf option it appeared to use the 'astrundir => /var/tmp' entry correctly.

I'll take a look and see if it seems to do this with any of the other options in asterisk.conf when -C is used.

What I tried is below:
in asterisk.conf, 'astrundir => /var/tmp'
# asterisk -C asterisk.conf
Asterisk already running on /var/run/asterisk.ctl. Use 'asterisk -r' to connect.
# ls /var/run/asterisk.ctl
# ls /var/tmp/asterisk.ctl
ls: /var/tmp/asterisk.ctl: No such file or directory

By: ltropiano (ltropiano) 2004-08-28 12:08:38

This can be closed...

-C option needs to have a full pathname (doh!) and then it'll work.  If the asterisk.conf file cannot be found (ie. it didn't have a full pathname) it defaults to Makefile compiled options.  Maybe a "WARNING" would have been nice that it couldn't find asterisk.conf, defaulting to compiled runtime variables.

By: Mark Spencer (markster) 2004-08-28 12:12:32

Added the warning to CVS...

By: Digium Subversion (svnbot) 2008-01-15 15:05:58.000-0600

Repository: asterisk
Revision: 3669

U   trunk/apps/Makefile
U   trunk/asterisk.c

r3669 | markster | 2008-01-15 15:05:58 -0600 (Tue, 15 Jan 2008) | 2 lines

Warn if unable to open an overridden config file (but ASTERISK-2255)