Asterisk add as service


Jump to: navigation, search

In order to add asterisk to services so it will be started when restarting the server and use the following:

/etc/init.d/asterisk stop 
/etc/init.d/asterisk status
/etc/init.d/asterisk start

go to the asterisk contrib folder (version 1.4.18 in this case)

cd /opt/asterisk-

copy the file as "asterisk" to the init.d folder:

cp rc.redhat.asterisk /etc/init.d/asterisk


chmod 755 /etc/init.d/asterisk 

add the service

chkconfig --add asterisk

start on boot:

chkconfig --level 345 asterisk on

check it was added:

chkconfig --list | grep asterisk

test it:

/etc/init.d/asterisk stop 
/etc/init.d/asterisk status
/etc/init.d/asterisk start
reboot the server

If you are using asterisk realtime - make sure the mysql is automatically started too:

 chkconfig --level mysqld 345
Personal tools