Hi all,
Here’s what I came up with. I based the command against the koha-plack script.
I think a person could use systemd “instances” to make some of the command arguments more dynamic, which you’d want for a package install.
One could also explore other configuration options. I suppose we could also have a wrapper script executed instead of executing starman directly.
Lots of possibilities!
SystemD Service File:
##################################################################
[Unit]
Description=Koha Test Plack
[Service]
ExecStart=/usr/bin/starman \
--max-requests 50 \
--workers 2 \
--access-log /opt/koha/logs/plack.log \
--error-log /opt/koha/logs/plack-error.log \
-E deployment \
--socket /opt/koha/var/plack.sock \
/opt/koha/plack.psgi
Environment=PERL5LIB=/opt/koha/lib
Environment=KOHA_CONF=/opt/koha/etc/koha-conf.xml
Environment=KOHA_HOME=/opt/koha
Restart=always
RestartSec=15
[Install]
WantedBy=multi-user.target
##################################################################
David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St
Ultimo, NSW 2007
Australia
Office: 02 9212 0899
Direct: 02 8005 0595
From: koha-devel-bounces@lists.koha-community.org [mailto:koha-devel-bounces@lists.koha-community.org] On Behalf Of David Cook
Sent: Tuesday, 23 October 2018 1:07 PM
To: koha-devel@lists.koha-community.org
Subject: [Koha-devel] Replacing koha-plack, koha-start-zebra, etc with systemd services?
Hi all,
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.
Mason did a great job with a systemd service https://github.com/KohaAloha/koha-mysql-init/blob/master/koha-mysql-init.service for getting around the autoincrement issue (fixed in MySQL 8.0 https://dev.mysql.com/doc/refman/8.0/en/innodb-auto-increment-handling.html and MariaDB 10.2.4 https://mariadb.com/kb/en/library/auto_increment/).
Anyway, once I’ve got something working, I’m happy to share it. Curious if anyone has any systemd unit files they’d like to share.
David Cook
Systems Librarian
Prosentient Systems
72/330 Wattle St
Ultimo, NSW 2007
Australia
Office: 02 9212 0899
Direct: 02 8005 0595