程序安裝在/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