Solved

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

Posted on 2009-07-03
8
2,121 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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
 
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

Independent Software Vendors: 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

Implementing Avaya's One-X portal is pretty painless, until you want to deploy this to the Android and iPhone clients when these clients are outside of your network. The clients will also work within your local network. Here is our experience and so…
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
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

759 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