Supervisor on app09
Configuration file
The configuration file for supervisor itself is /etc/supervisord.conf.
Each process managed by supervisor will have an entry in the last section of this file:
[program:basil-zeo] command=/var/db/zope/basil/parts/zeoserver/bin/runzeo priority=1 autostart=true
One tricky thing is that the value for command is the runnable script inside parts, not the bin/instance and bin/zeoserver scripts you might be used to using when running zope and zeo when doing development.
Checking on status of managed processes
You can check the status of all processes managed by supervisord by running the status subcommand:$ supervisorctl status basil RUNNING pid 20228, uptime 10 days, 0:06:42 basil-zeo RUNNING pid 11924, uptime 11 days, 0:55:02 cardamom RUNNING pid 22910, uptime 0:13:10 cardamom-zeo RUNNING pid 22908, uptime 0:13:15
Starting and stopping supervisord**
To start the actual supervisord daemon itself:
sudo /usr/local/etc/rc.d/supervisor start
To stop:
sudo /usr/local/etc/rc.d/supervisor stop
Starting and stopping managed processes
For a single process:
supervisorctl [start|stop|restart] [processname]You can also start and stop all
managed processes at once:
supervisortctl [start|stop] all
The managed process names adhere to a pretty simple convention. For zope instances, the name is the same as the buildout directory (basil, cardamom, etc.). The related zeo process with just be the name of the buildout, then '-zeo'. So, 'cardamom-zeo', etc.
**Important note!
If you are going to restart the supervisord process itself, you should stop all its managed processes first!
Otherwise the processes will continue unmanaged, and you'll need to kill them by hand.
Ok, so I screwed up. How do I kill them by hand?
The easiest thing to do is to grep from processes running under python:
$ ps aux | grep python zope 11922 0.0 0.2 46508 14124 ?? Ss 5:50PM 0:00.87 /usr/local/bin/python2.4 /usr/local/bin/supervisord zope 11923 0.0 0.2 50704 15872 ?? S 5:50PM 0:02.70 /usr/local/bin/python2.4 /var/db/zope/cardamom/parts/zope2/lib/python/ZEO/runzeo.py -C /var/db/zope/cardamom/parts/zeoserver/etc/zeo.conf zope 11924 0.0 0.2 53920 17208 ?? S 5:50PM 0:03.51 /usr/local/bin/python2.4 /var/db/zope/basil/parts/zope2/lib/python/ZEO/runzeo.py -C /var/db/zope/basil/parts/zeoserver/etc/zeo.conf zope 11926 0.0 3.2 351328 269788 ?? I 5:50PM 1:44.31 /usr/local/bin/python2.4 /var/db/zope/basil/parts/zope2/lib/python/Zope2/Startup/run.py -C /var/db/zope/basil/parts/instance/etc/zope.conf zope 11929 0.0 2.5 291536 210180 ?? I 5:50PM 1:13.02 /usr/local/bin/python2.4 /var/db/zope/cardamom/parts/zope2/lib/python/Zope2/Startup/run.py -C /var/db/zope/cardamom/parts/instance/etc/zope.conf
You can then kill the processes using the process ID's. It's probably better to kill the children (higher process ID's) first.
$ sudo kill -9 11929 $ sudo kill -9 11926 $ sudo kill -9 11924 ...You want to only kill processes that refer to a zope or zeo configuration. Once they're all <...ahem...> dead, you can restart supervisord and all processes marked with autostart=true will come up automatically.
