如何为FreeSWITCH配置Supervisord?

2024-10-04 03:26:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图配置一个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

当我使用supervisord命令启动管理器时,它会毫无错误地启动freeswitch进程。但是当我试图使用supervisorctl命令重新启动freeswitch时,它不起作用,并出现以下错误。在

^{pr2}$

我看不到日志中报告的任何错误(/var/log/supervisor/自由开关.log). 然而,我看到了以下内容:

1773 Backgrounding.
1777 Backgrounding.
1782 Backgrounding.

它似乎开始了自由开关的三个过程。这不是不对吗?在

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


Tags: tosendlogtruevar错误rootprogram
2条回答

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

对于freeswitch,只需删除-nc选项,使其在前台运行;supervisor将适当地指导标准流,并在进程崩溃时重新启动该进程。在

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

相关问题 更多 >