CentOS7上設置FreeSwitch自啟動


程序安裝在/usr/local/freeswitch目錄,root用戶。

1、在目錄/usr/lib/systemd/system下創建文件freeswitch.service,內容如下:

[Unit]
Description=FreeSWITCH After=syslog.target network.target After=postgresql.service postgresql-9.3.service postgresql-9.4.service mysqld.service httpd.service [Service] User=root EnvironmentFile=-/etc/sysconfig/freeswitch WorkingDirectory=/usr/local/freeswitch ExecStart=/usr/local/freeswitch/bin/freeswitch -nc -nf $FREESWITCH_PARAMS ExecReload=/usr/bin/kill -HUP $MAINPID #ExecStop=/usr/local/freeswitch/bin/freeswitch -stop $FREESWITCH_PARAMS ExecStop=/bin/kill -9 $MAINPID [Install] WantedBy=multi-user.target

 


2、在目錄/etc/sysconfig下創建文件freeswitch,內容如下:

## Type:                string
## Default:             "" ## Config: "" ## ServiceRestart: freeswitch # # if not empty: parameters for freeswitch # FREESWITCH_PARAMS=""

 

3、修改
cd /usr/local/
chown -R root:root freeswitch
chmod -R g+w freeswitch

4、啟動
開機啟動:systemctl enable freeswitch.service
啟動服務:systemctl start freeswitch.service
結束服務:systemctl stop freeswitch.service


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM