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

Tzafrir Cohen tzafrir.cohen at xorcom.com
Fri Feb 12 06:15:01 CST 2010


On Thu, Feb 11, 2010 at 07:36:23AM -0500, Leif Madsen wrote:
> 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/.  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.
> > 
> > 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?).
> > 
> > Please report an issue on http://issues.asterisk.org/
> 
> For future reference, the issue reported is #16802.
> 
> https://issues.asterisk.org/view.php?id=16802

The report in the bug is not clear.

If you run Asterisk as non-root, asterisk should have write permissions
to the astvarrun directory. Thus it should be the subdirectory
/var/run/asterisk .

Packages on Debian has long ago defaulted to even prevent running as
root, and had astvarrundir set to /var/run/asterisk as a compile-time
default for quite some time.

The Ubuntu packages, based mostly on the Debian ones, had to face the
fact that Ubuntu deletes everything under /var/run by default at boot.
Thus the init.d script was fixed to (re)create that directory.

This fix made it eventually into the Debian packages, and also
(eventually, and independently) into the standard "debian" asterisk
init.d script.

So the questions to ask are, I believe:

* Should asterisk here be run as root? If so: why?
* Where should the astvarrundir be?

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list