Starting asterisk at boot?

Hello World! Soon to be obvious I’m a newbie to both Linux and Asterisk. This seemed like a perfect project to get me up to speed in the linux world along with some needed PBX experience.

So the confusing part I’m having is startup options.

My current install of asterisk is running on the latest CentOS 5.4. I have installed asterisk via Yum…it starts and runs fine…I was able to get it to automatically start at bootup using the script in the init.d folder…but according to the book “Asterisk–The Future of Telephony” the prefered startup method is to use the safe_asterisk script…but it doesn’ tell me(unless it’s in some other chapter) how to get linux(CentOS) to launch this script at boot time.

So, using CentOS disto…where the heck to I tell it to launch this script?

Side note:
Using Putty to SSH into the machine…once I get it running usign safe_asterisk…how the heck to I change to the terminal running asterisk(someone mentioned hitting ALT-F9 or something…but in putty it just blasts some [[[[^ style stuff.

Thanks!
Josh

echo ‘safe_asterisk’ >> /etc/rc.d/rc.local

If you install, on CentOS, from source, it will automatically use safe_asterisk. I hope the RPM does as well.

The advice on appending a line to the script is flawed, as you already have startup code that starts Asterisk. Also, it is not a good idea to mess with startup scripts if you don’t have some idea of how startup works.

david55:
If you build from source it does not create a daemon nor will it touch the start up scripts so it should be safe. (If they don’t know how to do it on their own they didn’t touch the file :wink: )

If you build from source, and do something like “make configs” it does install the startup scripts.

I stand corrected. So you should do as follows:

  1. Go in to asterisk source directory
  2. Type in make config
  3. chkconfig asterisk on

reboot the server and make sure that asterisk starts at boot.

make config does the chkconfig

thanks for the help…I’m starting to get the hang of this thing a little bit now :->…kind of a big bite to take learning both linux and asterisk at once…but I guess how else would you learn an OS without having somethign to do on it eh?

Josh