≡ Start On Boot
It’s rare that you’ll have to restart your server, but when you do, it can be helpful to have important programs startup automatically.
With Asterisk, this is easy. First you need the init.d script, which is located in contrib/init.d/ in the Asterisk source. There are a few different versions depending on your distro.
For Ubuntu/Debian: cp contrib/init.d/rc.debian.asterisk /etc/init.d/asterisk
For Fedora/Redhat: cp contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk
With that in place, you’ll need to set it up to run on boot.
For Ubuntu: we’ll use a tool called sysv-rc-conf. [sudo apt-get install sysv-rc-conf]
The tool lists all services that can be loaded at boot, along with the run levels they are set to load for. I cannot stress this enough - do not play around with services/runlevels you do not understand. Doing so can prevent your server from booting.
Use your arrow down to find asterisk in the list. Then move to position 2, 3, 4, and 5, pressing space on each to check it. Press q once you are done. The next time you reboot Asterisk will be started.
For Fedora/Redhat: # checkconfig –level 35 asterisk on
35 refers to run levels 3 and 5. Adjust this to suit your needs. Again - do not play with checkconfig with other services and runlevels if you are unsure.
Hopefully - You don’t ever need to have this actually works. Linux should never be rebooted =]
- the evil genius

