CentOS 7.2,我手动设置了 systemd 文件,如下所示:
cat /usr/lib/systemd/system/freeswitch.service
[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStart=/usr/local/freeswitch/bin/freeswitch -u root -g daemon -ncwait -nonat
TimeoutSec=45s
Restart=always
; exec
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=250000
LimitRTPRIO=infinity
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target
但systemctl start freeswitch
行为不正确,例如执行两次或在我执行处理查询时停止它继续运行。
ps aux | grep freeswitch
root 31739 0.0 0.1 104552 3712 ? Ss 20:46 0:00 /usr/local/freeswitch/bin/freeswitch -u root -g daemon -ncwait -nonat
root 31740 8.5 1.4 1148068 26508 ? S<sl 20:46 0:00 /usr/local/freeswitch/bin/freeswitch -u root -g daemon -ncwait -nonat
我该如何修复它?