Python 如何为FreeSWITCH配置Supervisord?

Python 如何为FreeSWITCH配置Supervisord?,python,ubuntu-12.04,supervisord,freeswitch,Python,Ubuntu 12.04,Supervisord,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

我正在尝试配置用于控制的。下面是此时出现在
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
当我使用
supervisord
命令启动监控程序时,它会毫无错误地启动freeswitch进程。但是,当我尝试使用
supervisorctl
命令重新启动freeswitch时,它不工作,并出现以下错误

freeswitch: ERROR (not running)
freeswitch: ERROR (abnormal termination)
我看不到日志(/var/log/supervisor/freeswitch.log)中报告的任何错误。然而,我看到以下情况:

1773 Backgrounding.
1777 Backgrounding.
1782 Backgrounding.
它似乎开始了三个自由切换的过程。这不对吗


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

supervisor
要求运行的程序不要转移到后台;毕竟,创建它是为了作为后台进程运行那些不可行或难以正确生成后台监控代码的程序。因此,对于与supervisor一起运行的每个程序,请确保它不会在后台分叉


对于freeswitch,只需删除
-nc
选项即可使其在前台运行;supervisor将正确引导标准流,并在进程崩溃时重新启动进程。

请记住,进程继承父进程的ulimits值,因此在您的情况下,freeswitch将使用与其父进程supervisor相同的ulimits运行。。。我不认为这是像freeswitch这样的资源密集型应用程序所需要的,这意味着将supervisord与freeswitch一起使用实际上是一个非常糟糕的主意。
如果您必须坚持使用它,那么您必须在文档中找到如何提高supervisord的所有ulimit值。

您是否已经尝试删除
-nc
以不在后台模式启动?还没有,正在尝试。.不使用-nc有什么缺点吗?我不知道。我通常在
screen
中启动
freeswitch
,这样就可以轻松地通过SSH连接到服务器并立即与FS交互(如
FS_cli
)。@RobW能否请您发表评论作为答案?我很乐意赏金给它。谢谢。安蒂·哈帕拉的回答已经包含了我的评论,所以我认为再发一次也没有意义。很高兴能帮忙!对于FreeSWITCH 1.6.8和Supervisord 3.2.1,这对我来说不起作用。有效的方法是添加nofork选项--“-nc-nf-core”。这还有一个额外的优点,那就是它放弃了标准输出,这正是人们想要的,因为FreeSWITCH有自己的伐木机器。