系統重新啟動時自動啟動星號 (start asterisk autometically when system got restarted)


問題描述

系統重新啟動時自動啟動星號 (start asterisk autometically when system got restarted)

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.


參考解法

方法 1:

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.

方法 2:

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> 

方法 3:

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

方法 4:

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

(by Code Breakerolivecoderjack cardozouser214393nepdev)

參考文件

  1. start asterisk autometically when system got restarted (CC BY-SA 3.0/4.0)

#service #asterisk #Centos #linux






相關問題

服務間數據的參照完整性 (Referential Integrity of Data Between Services)

系統重新啟動時自動啟動星號 (start asterisk autometically when system got restarted)

CanStop 設置為 False 時停止 Windows 服務的方法 (C#) (Way to Stop a Windows Service when CanStop is set to False (C#))

Android: App Widget trong quá trình cập nhật hiển thị hình ảnh lạ (Android: App Widget during update shows strange images)

查找具有特定 startname 的特定服務 (Finding specific services with specific startname)

如何判斷方法是否從 .Net(託管)代碼中的 Windows 服務調用 (How to tell if method is called from Windows Service in .Net (managed) code)

如何使用主屏幕小部件按鈕關閉服務? (How to use a homescreen widget button to shutdown a service?)

如何將版本號放入 rdlc 文件中? (How do you put a version number into an rdlc file?)

android asynTask 到活動問題? (android asynTask to activity problem ?)

GetCurrentDirectory 並沒有真正返回可執行文件的路徑 (GetCurrentDirectory does not really return the path of the executable file)

通知未顯示,因為服務或警報管理器已被終止 (Notification not showing because service or alarm manager is killed off)

當 gunicorn / celery 服務重新啟動時,Django 中有沒有辦法只執行一次 python 代碼? (Is there a way in Django to execute some python code only once when gunicorn / celery services are getting restarted?)







留言討論