编程语言
首页 > 编程语言> > python-如何为FreeSWITCH配置Supervisord?

python-如何为FreeSWITCH配置Supervisord?

作者:互联网

我正在尝试配置Supervisor以控制FreeSWITCH.以下是此页面上当前在supervisord.conf中的配置.

[program:freeswitch]
command=/usr/local/freeswitch/bin/freeswitch -nc -u root -g root 

numprocs=1
stdout_logfile=/var/log/supervisor/freeswitch.log
stderr_logfile=/var/log/supervisor/freeswitch.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600

; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true

当我使用超级用户命令启动超级用户时,它将启动freeswitch进程而不会出现任何错误.但是,当我尝试使用supervisorctl命令重新启动freeswitch时,它不起作用并给出以下错误.

freeswitch: ERROR (not running)
freeswitch: ERROR (abnormal termination)

我无法在log(/var/log/supervisor/freeswitch.log)中看到任何错误报告.但是我看到以下内容:

1773 Backgrounding.
1777 Backgrounding.
1782 Backgrounding.

看来它开始了freeswitch的三个过程.这不是错吗?

有人可以指出这里有什么问题,并在需要时提供正确的配置吗?

解决方法:

主管要求运行程序不要派生到后台;毕竟,它被创建为作为后台程序运行,而对于那些程序而言,要正确编写守护程序代码将是不可行或困难的.因此,对于使用主管运行的每个程序,请确保它不会在后台派生.

对于freeswitch,只需删除-nc选项以使其在前台运行;主管将适当地引导标准流,并在崩溃后重新启动该过程.

标签:supervisord,freeswitch,ubuntu-12-04,python
来源: https://codeday.me/bug/20191029/1958363.html