Solved

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

Posted on 2009-07-03
8
2,065 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

14 Experts available now in Live!

Get 1:1 Help Now