Managing Plone and Bika LIMS with Supervisor - jean/Bika-LIMS GitHub Wiki
First install and start supervisor:
sudo apt-get install supervisor
/etc/init.d/supervisor start
Then create and edit a new configuration file in /etc/supervisor/conf.d:
sudo vi /etc/supervisor/conf.d/bika.conf
Insert the following contents into the file, and edit them to suit your needs:
[program:bika-zeoserver]
directory=/usr/local/Plone/zeocluster
command=/usr/local/Plone/zeocluster/bin/zeoserver fg
user=plone_daemon
redirect_stderr=true
stopwaitsecs=60
autostart=false
[program:bika-client1]
directory=/usr/local/Plone/zeocluster
command=/usr/local/Plone/zeocluster/bin/client1 console
user=plone_daemon
redirect_stderr=true
stopwaitsecs=60
autostart=false
[program:bika-client2]
directory=/usr/local/Plone/zeocluster
command=/usr/local/Plone/zeocluster/bin/client2 console
user=plone_daemon
redirect_stderr=true
stopwaitsecs=60
autostart=false
After editing the config file, you need to run the following command:
sudo supervisorctl reread
sudo supervisorctl update
Plone will now start with each reboot, and supervisor will restart Plone if anything goes wrong.
Be careful! Supervisor takes control of the Plone processes, and you can no longer manipulate them directly. Instead, you must always stop, start and restart Plone using supervisor:
sudo supervisorctl stop bika-zeoserver bika-client1 bika-client2
sudo supervisorctl start bika-zeoserver bika-client1 bika-client2
sudo supervisorctl restart bika-zeoserver bika-client1 bika-client2