[Koha-devel] Replacing koha-plack, koha-start-zebra, etc with systemd services?

Dave Sherohman dave at sherohman.org
Thu Oct 25 14:48:10 CEST 2018


On Tue, Oct 23, 2018 at 01:07:17PM +1100, David Cook wrote:
> I'm about to start working on a systemd service for running Plack (for a
> non-package Koha install), and I was wondering if anyone else has thought
> about or is using systemd services for Plack, Zebra, etc. 

I'm currently faking it with init.d-scripts-under-systemd for zebra,
sip, and ncip services, but I have created a couple real systemd config
files for koha-under-plack.  Converting sip/ncip/zebra from init.d
scripts is on my to-do list, but, well...

I'm no systemd expert (not even a systemd fan, but that's the way the
wind is blowing) and don't really know what I'm doing with systemd
service files, so they're very basic and could almost certainly be
improved upon, but they do work.


--- koha-opac.service ---
[Unit]
Description=Koha opac backend
After=network.target

[Service]
Type=forking
PIDFile=/var/run/koha/opac.pid
User=www-data
Group=www-data
ExecStart=/etc/nginx/starman/opac-server.sh
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill $MAINPID
Restart=always

[Install]
WantedBy=multi-user.target


--- koha-staff.service ---
[Unit]
Description=Koha staff backend
After=network.target

[Service]
Type=forking
PIDFile=/var/run/koha/staff.pid
User=www-data
Group=www-data
ExecStart=/etc/nginx/starman/staff-server.sh
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill $MAINPID
Restart=always

[Install]
WantedBy=multi-user.target


-- 
Dave Sherohman


More information about the Koha-devel mailing list