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

Asterisk Not Start At Boot

Posted on 2011-09-11
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?

Question by:Silas2

Accepted Solution

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.

Assisted Solution

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

LVL 28

Assisted Solution

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.
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.


Author Comment

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

Author Comment

ID: 36522098
PS if i type sudo /etc/init.d/asterisk, it does start ok.
LVL 28

Expert Comment

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.

Author Comment

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?
LVL 28

Expert Comment

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?  

Author Comment

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)
LVL 28

Assisted Solution

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.

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to install java on RHEL image on EC2 4 38
open source backup solution 1 36
Linux script delete files 3 47
Linux Real Time Memory on Distinct 24 Cycle 7 29
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…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

792 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