I am trying to configure a Supervisor for controlling the FreeSWITCH. Following is the configuration at this moment present in 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
When I an starting the supervisor using supervisord
command, it starts the freeswitch process without any error. But when I am trying to restart the freeswitch using supervisorctl
command, its not working and giving following errors.
freeswitch: ERROR (not running)
freeswitch: ERROR (abnormal termination)
I am not able to see any error reported in log(/var/log/supervisor/freeswitch.log). However I am seeing following:
1773 Backgrounding.
1777 Backgrounding.
1782 Backgrounding.
It seems its starting three process of freeswitch. Isn't this wrong?
Can someone point out what's problem here and provide correct configuration if require ?
supervisor
requires that the run programs do not fork to background; after all it was created to run as background processes those programs for which it would be infeasible or difficult to make correctly daemonising code. Thus for each program you run with supervisor, make sure that it does not fork on background.
In the case of freeswitch, just remove the -nc
option to cause it run on foreground; supervisor will direct the standard streams appropriately and restart the process if it crashed.