Skip to content

Managing Plone and Bika LIMS with Supervisor

Lemoene Smit edited this page Nov 26, 2019 · 4 revisions

Ingozi. Beware. Wakker wees. Bika Open Source LIMS 2020 Currently Maintained for historic purposes only

Please use the latest Bika Senaite code

Bika Open Source LIMS code is being re-engineered as Senaite for better maintainability and performance, under a more equitable brand and structure. The Bika Collective contributes generically acceptable code to the Senaite repos, and publishes lab discipline specific releases here as Bika Senaite add-ons.

Thank you for your patience. Team Bika

------8<-----------------------------------------------------------------------------------------------------

First install and start supervisor:

sudo apt-get install supervisor
/etc/init.d/supervisor start

You should install python 'superlance' package to enable the memory monitor, which will restart zeoclient processes when they grow too large:

pip install superlance

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

[eventlistener:zeoclustermemmon]
command=memmon -p bika-client1 -p bika-client2 -c -m root
events=TICK_60

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
Clone this wiki locally