1

I have installed asterisk 1.4 on linux centOS 6.2. and I have also made entry to start asterisk in /etc/rc.local as /usr/bin/asterisk. but it did not worked. When the system starts, it shows that asterisk service has started but actually it's not working i.e. command asterisk-vvvvr does not work.

If I start the service manually after boot up the system, it works perfectly. can someone tell why asterisk is not working via rc.local file and I can start the asterisk automatically at system start up.

thanks in advance. PS: I have already tried a lot of methods by googling but there is still problem.

MrNice
  • 646
  • 8
  • 23
Code Breaker
  • 479
  • 1
  • 4
  • 19

4 Answers4

4

To get a proper init script and enable asterisk to start automatically on boot: change to the asterisk source directory and do this:

make config
chkconfig asterisk on

after that you can reboot.

olivecoder
  • 2,576
  • 17
  • 19
  • Could you paste the output here? Are you installing from source? – olivecoder Aug 21 '12 at 12:26
  • I am not getting your point, when I try to verbose it show error: 'Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)' – Code Breaker Aug 29 '12 at 08:37
  • please issue: "/etc/init.d/asterisk start" and post the output and say me if you are installing from source or other method. – olivecoder Aug 29 '12 at 14:02
  • it give me error as "-bash: /etc/init.d/asterisk: No such file or directory" but I can start the service asterisk as- by just type "asterisk" – Code Breaker Aug 31 '12 at 06:38
1

one subtle assumption here: to enable asterisk automatically on bootup, you have to be root and issue the command, ckhconfig (from olivecoder's steps)

$ sudo chkconfig asterisk on

  • to verify that asterisk is indeed turned on, you should see something like

$ chkconfig |grep asterisk

asterisk 0:off 1:off 2:on 3:on 4:on 5:on 6:off

  • to start the service w/o rebooting, you can try

$ sudo service asterisk start

  • finally, to run the cli

$ sudo asterisk -rvvv

--- you should get something like this:

remus*CLI>

jack cardozo
  • 71
  • 1
  • 2
0

Just goto asterisk directory where you have all asterisk binaries and run below command.

In my case my asterisk binaries are at.

/usr/src/asterisk.

root@asterisk# make config

chriz
  • 1,311
  • 2
  • 16
  • 31
0

SELinux can also be a problem.

See this Stackoverflow post here, which says:

If you have SELINUX enabled, it will prevent this file being created. You need to turn it off.

vi /etc/selinux/config
set SELINUX=disabled
reboot
nepdev
  • 881
  • 1
  • 11
  • 18