CentOS7系统上设置freeswitch的自启动

程序安装在/usr/local/目录,用户是root

1、在目录/usr/lib/systemd/system下创建文件astswitch.service,内容如下

vi /usr/lib/systemd/system/astswitch.service

[Unit]
Description=AstSWITCH
After=syslog.target network.target
After=postgresql-9.6.service nginx.service

[Service]
User=root
EnvironmentFile=-/etc/sysconfig/astswitch
WorkingDirectory=/usr/local/freeswitch
ExecStart=/usr/local/freeswitch/bin/freeswitch -nc -nf $FREESWITCH_PARAMS
ExecReload=/usr/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

2、在目录/etc/sysconfig下创建文件astswitch,内容如下:

vi /etc/sysconfig/astswitch

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

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

4、启动
systemctl enable astswitch.service
systemctl start astswitch.service

扫描二维码关注公众号,回复: 1042431 查看本文章

猜你喜欢

转载自www.cnblogs.com/aimod/p/9093606.html