Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Asterisk couldn't run because of permissions...//var/run/asterisk.pid  -- On boot up

Posted on 2009-07-03
8
Medium Priority
?
2,249 Views
Last Modified: 2013-11-15
Asterisk will not start on boot up after upgrade to Ubuntu 9.0.4 from 8.10

Asterisk couldn't run because of permissions...//var/run/asterisk.pid  -- On boot up



0
Comment
Question by:jkockler
  • 6
  • 2
8 Comments
 
LVL 14

Expert Comment

by:Fabio Marzocca
ID: 24774003
Kill Asterisk and stop any of its running services, then try changing the owner:

sudo chown asterisk:asterisk /var/run/asterisk

0
 
LVL 4

Author Comment

by:jkockler
ID: 24774106
Okay, the file "asterisk.pid" only exists when Asterisk is running.  I changed the owner of the file, with the command you gave me.  It changed the owner to Asterisk, then rebooted, with the same error.  I checked for the file "asterisk.pid" before starting asterisk, to find it was not there.  I started Asterisk and the file appeared.

This must mean that a preliminary Asterisk startup command is either failing, or not runing at all, and the error message is a result of the file "asterisk.pid" not existing.

Any ideas?

0
 
LVL 4

Author Comment

by:jkockler
ID: 24774118
I am also getting a Zaptel error on boot, that says "waiting for Zaptel to come online"  -- Then fails with Zaptel not installed.

I do not have any Zaptel hardware, or anything that i know of that requires it.  Is this a problem, and could it be causing Asterisk not to start properly?

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:Fabio Marzocca
ID: 24776290
You can't change permission to file .pid, as it will appear only when running.

Stop Asterisk and run this:

sudo chown -R asterisk:asterisk /var/run/asterisk

0
 
LVL 4

Author Comment

by:jkockler
ID: 24776909
I looked at "asterisk.conf"

I noticed the line
"astrundir => /var/run/"    and so I changed it to
"astrundir => /var/run/asterisk"  -----
Then I ran your command above.

That resolved the error on boot up, but Asterisk is still not started when the machine boots.
I still have to run "sudo asterisk" in order for it to start.


0
 
LVL 4

Author Comment

by:jkockler
ID: 24776930
Well, slight correction,

The .pid file and .ctl file exist in the //var/run/asterisk directory on bootup, but non of the phones will register, and when I try to connect to the CLI, it fails with "Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?"

If I run sudo asterisk, everything starts to work.
0
 
LVL 4

Accepted Solution

by:
jkockler earned 0 total points
ID: 24777186
Well looks like I found the fix:

First I changed asterisk.conf back to the original settings of
"astrundir => /var/run/"

Then I followed the steps at this link http://www.voipuser.org/forum_topic_3621.html

All the steps are on the lastest post, on the thread, if anyone else has this problem.
0
 
LVL 4

Author Comment

by:jkockler
ID: 24777308
And here are the steps, in case the other site goes away;

I tested the debian script on my Ubuntu 7.10 and it work.

copy /mytemp/asterisk-1.4.19/contrib/init.d/rc.debian.asterisk
to /etc/init.d/asterisk
chmod 755 /etc/init.d/asterisk

cd /etc/init.d
# to remove the script from boot
update-rc.d -f asterisk remove

# to set the script as boot
update-rc.d asterisk defaults
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you think no one can listen in on your VOIP conversations, eh? Well... if you haven't setup Secure Real Time Transport (SRTP), your voice communications can be hacked into by just about anyone! First, let's talk about the intended audience for…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question