Solved

Asterisk Not Start At Boot

Posted on 2011-09-11
10
558 Views
Last Modified: 2013-11-12
I've just done a clean install of Ubuntu 11.xx + a new asterisk 1.8.6 install, I put a startup script in /etc/init.d/asterisk (the script is called 'asterisk'), but it won't seem to start on boot, excuse my Linux newbie ignorance, but if i type 'sudo asterisk' in the /etc/init.d folder, it does run, so is it a permissions issue? Does linux know to run these startup scripts without telling it?

0
Comment
Question by:Silas2
10 Comments
 
LVL 4

Accepted Solution

by:
degaray earned 63 total points
ID: 36518841
Type this to see your permissions

ls -l /the/path/to/asterisk

replace the/path/to/asterisk with the actual path and lets see what your permissions are.

Also, since you are using ubuntu, I would suggest you install asterisk straight from repositories, in the same way you would install other software. It should get you a very stable installation.
0
 
LVL 3

Assisted Solution

by:erictronic
erictronic earned 62 total points
ID: 36518847
It is not enought to have the script in /etc/init.d/. You also need (soft) links in the "runlevel folders" /etc/rc[0-6].d/.

Lookup your default runlevel like this:

grep default /etc/inittab

Let's say it is "3", then create a softlink to your start script ...

ln -s /etc/init.d/asterisk /etc/rc3.d/S99asterisk

and stop script

ln -s /etc/init.d/asterisk /etc/rc3.d/K99asterisk

reboot...
0
 
LVL 28

Assisted Solution

by:FishMonger
FishMonger earned 125 total points
ID: 36519076
You didn't say how you installed asterisk, but I'll assume you did a typical build (i.e., ./configure make and make install).  If that's the case, it sounds like you forgot to do the 'make config' which installs the startup scripts in their proper locations.  So, go back to the build directory and do the 'make config' and reboot, that will be easier and IMO better than manually creating the files.
0
 

Author Comment

by:Silas2
ID: 36522089
Thanks for all of your suggestions.
FishMonger: I'm not sure if i did run the 'make config' so I renamed the /etc/init.d/asterisk file to '.old', ran 'make config' but the 'make config' kept saying links already existed, does this mean I had run it?
erictronic, I ran those commands
ln -s /etc/init.d/asterisk /etc/rc3.d/S99asterisk which seemed to run with no complaint, but still no start on boot.
degray: I ran that command which came back with:
-rwxr-xr-x 1 root root 20672891 2011-09-10 18:27 /usr/sbin/asterisk
0
 

Author Comment

by:Silas2
ID: 36522098
PS if i type sudo /etc/init.d/asterisk, it does start ok.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 28

Expert Comment

by:FishMonger
ID: 36522808
All of my asterisk installs are on CentOS and besides having the startup scripts in the proper locations, I also need to use the chkconfig command to tell the system which services I want to run at bootup and for which run level(s).  I'm not sure what the equivalent command would be in Ubuntu, but that appears to be what you're missing.
0
 

Author Comment

by:Silas2
ID: 36536720
Sorry I'm so dilatory with this post, its just I'm trying to get this server back together and I deprioritize the startup when its running, then i do a reboot...
I've just installed and run chkconfig and asterisk =234, I think that means its running at three run levels, I don't know what that means about startup?
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 36537062
On all of my installs, asterisk loads on runlevels 2 thru 5.

Are you saying that after using chkconfig, asterisk is now starting during bootup?  
0
 

Author Comment

by:Silas2
ID: 36537580
Err...actually, I am. I've just realised it is running after a reboot. Regarding your comment 2->5, any reason mine might be 234? (I have to say all this runlevel suff is completely new to me coming from Windows)
0
 
LVL 28

Assisted Solution

by:FishMonger
FishMonger earned 125 total points
ID: 36539234
I haven't used Ubuntu yet, but it appears that it doesn't make any distinction between runlevels 2 thru 5 like other typical Linux systems.  So, in your case, it doesn't matter that it's not using runlevel 5.

Here's some info on the meaning of the runlevels.
http://en.wikipedia.org/wiki/Runlevel
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

13 Experts available now in Live!

Get 1:1 Help Now