python - 如何为 FreeSWITCH 配置 Supervisord?

标签 python ubuntu-12.04 supervisord freeswitch

我正在尝试配置 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 命令启动 supervisor 时,它会毫无错误地启动 freeswitch 进程。但是当我尝试使用 supervisorctl 命令重新启动 freeswitch 时,它不起作用并出现以下错误。

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

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

1773 Backgrounding.
1777 Backgrounding.
1782 Backgrounding.

好像是启动了freeswitch的三个进程。这不是错了吗?

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

最佳答案

supervisor 要求运行的程序不要fork到后台;毕竟它的创建是为了作为后台进程运行那些无法或难以正确编写守护程序代码的程序。因此,对于您使用 supervisor 运行的每个程序,请确保它不会在后台 fork 。

在freeswitch的情况下,只需删除-nc选项即可使其在前台运行; supervisor 将适本地引导标准流并在它崩溃时重新启动进程。

关于python - 如何为 FreeSWITCH 配置 Supervisord?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25419214/

相关文章:

python - 如何简单地从标准输入读取由空格或空格分隔的输入

postgresql - Vagrant 无法正常工作

heroku - 安装Heroku时我的包裹管理器坏了

ruby-on-rails - rails3 无法在生产模式下发送 smtp 电子邮件

python - 3d 空间中直线曲线的样条插值系数

python - Item_search 未返回所有报价

python - 在 PyPI 上分发时我应该针对哪些架构和操作系统?

django - 如何在 supervisor、gunicorn 和 django (1.6) 中使用环境变量

php - Supervisor VS CronJobs

linux - 如何重新创建正在运行的 supervisord 进程丢失的套接字