Solved

Asterisk Not Start At Boot

Posted on 2011-09-11
10
560 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
(Open)LDAP V2.44  search proxy to AD (W2012R2) 37 142
Setting up two Raspberry Pi gateways/routers 3 63
VMware Workstation 12 Player 16 75
number in printf 13 27
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

777 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