[asterisk-users] Unable to open pid file '/var/run/asterisk/asterisk.pid': No such file or directory

Brian brel.astersik100129 at copperproductions.co.uk
Wed Feb 10 12:50:41 CST 2010


On Wed, 2010-02-10 at 11:24 -0600, Jason Parker wrote:
> Brian wrote:
> > Each time the server is rebooted Asterisk duly
> > deletes the manually created /var/run/asterisk directory - quite why it
> > does this I just don't know - perhaps it is a bug?
> > 
> 
> Your assumption is incorrect.  Some Linux distributions will empty /var/run/ on 
> boot, just as they do with /tmp/.  
Thanks Jason - that had never dawned on me, but I've just tested it and
indeed it does.

> I do believe you're right, however, in 
> suggesting that there is a bug in Asterisk.  It appears that Asterisk creates 
> /var/run/asterisk/ during install and assumes that it will always exist.
Agreed - that would make sense that by default it thinks the directory
is there. The workaround / fix is to take out the (!)
from /etc/asterisk/asterisk.conf and allowing the default setting of:
astrundir => /var/run to come into play. It then puts the .pid and .ctl
in the root of /var/run
> 
> Some of the sample init scripts (Debian) create that directory before starting 
> Asterisk.  This should be done in all of them (or in Asterisk itself, maybe?).
The one I had didn't - but I could have added it. I just wanted to be
sure I was doing the right thing.
> 
> Please report an issue on http://issues.asterisk.org/
Done - but I'm a bit embarrassed as it seems so trivial.

Thank you for your help.
> 




More information about the asterisk-users mailing list