0

I have the following problem:

This is my supervisord.conf-addition:

[program:gearman-test-worker]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /path/to/gearman-jobs/worker.php
numprocs=5
directory=/path/to/gearman-jobs/
stdout_logfile=/var/log/gearman-job-server/supervisord.log
environment=GEARMAN_USER=gearman
autostart=true
autorestart=true
user=gearman
stopsignal=KILL

When I start it supervisord -n it will only spawn 1 instance instead of 5. The messages will look fine

[root@pc113 gearman-jobs]# supervisord -n
2013-09-03 14:24:58,775 CRIT Supervisor running as root (no user in config file)
2013-09-03 14:24:58,789 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Tue Sep  3 14:24:58 2013
        Hostname: <unix domain socket>
        Port:/var/tmp/supervisor.sock
2013-09-03 14:24:58,850 CRIT Running without any HTTP authentication checking
2013-09-03 14:24:58,850 INFO supervisord started with pid 8722
2013-09-03 14:24:58,853 INFO spawned: 'gearman-test-worker' with pid 8723
2013-09-03 14:24:59,858 INFO success: gearman-test-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

and no hint why it is only spawning a single instance. Can you help?

Martin Müller
  • 139
  • 1
  • 7

1 Answers1

1

If each process is meant to run on a different port, then it might be trying to spawn each one on the same port

You can use

numprocs_start=<PORT_NUM>

and pass process_num to what you are trying to start through the command

Full program config I have used with a python script

process_name=inf_svr%(process_num)s
directory=/media/sf_Projects/inf_api/inf_api/
environment=USER=root,PYTHONPATH=/usr/bin/
command=python /media/sf_Projects/inf_api/inf_api/inf_server.py --port=%(process_num)s
startsecs=2
user=root
autostart=true
autorestart=true
numprocs=4
numprocs_start=8080
Michael
  • 31
  • 8