Solved

Asterisk Not Start At Boot

Posted on 2011-09-11
10
562 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
[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
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

696 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