[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 09:00:08 CST 2010
On Wed, 2010-02-10 at 14:14 +0000, Brian wrote:
> On Wed, 2010-02-10 at 08:54 -0500, Ken Leland III wrote:
> > Brian,
> >
> > It could be that the ownership/permissions on the directory are not correct.
> > Are you running asterisk as asterisk:asterisk or root:root?
> >
> > Here is an article that lists the directories and what the ownership/permissions on each one should be:
> >
> > http://www.voip-info.org/wiki/view/Asterisk+non-root
>
> Thanks for that, but no - it runs as root, and root can
> create/access /var/run without any issues. I'm boggled...
Answering my own question the solution lies
in /etc/asterisk/asterisk.conf:
Take the (!) out of /etc/asterisk/asterisk.conf
Whilst logic would tell me to replace:
astrundir => /var/run
to
astrundir => /var/run/asterisk
...this did not work. 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?
Leaving: astrundir => /var/run as it is and removing (!)
from /etc/asterisk/asterisk.conf does the trick. On rebooting /var/run
gets the required .ctl/.pid files and all warnings are banished:
srwxr-xr-x 1 root root 0 2010-02-10 14:50 asterisk.ctl
-rw-r--r-- 1 root root 5 2010-02-10 14:50 asterisk.pid
into /var/run and all warnings vanish of missing .pid and .ctl files are
banished.
Hopefully this will help someone else. I've seen lots of solutions
saying 'create /var/run/asterisk' that have not stood the test of a
reboot.
More information about the asterisk-users
mailing list