Solved

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

Posted on 2009-07-03
8
2,048 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:fmarzocca
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
 
LVL 14

Expert Comment

by:fmarzocca
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Users are often faced with high disk consumption without really knowing where the largest amount of data resides. Disk Usage Analyzer (aka Baobab) is is a graphical, menu-driven application to analyse disk usage in any Gnome environment and can e…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now