Browse Source

Bug 26363: Provide a systemd unit file for koha-worker for source installs

This patch adds a systemd unit file which gets rewritten according to
the configuration specified by Makefile.PL. This can be linked or
copied to systemd directories for running a systemd service for
background_jobs_worker.pl

Test plan:
1. perl Makefile.PL
1a. Choose "single" installation
1b. Choose "/opt/koha" for a file path
2. make
3. vi blib/KOHA_CONF_DIR/koha-worker.service
4. Verify that PERL5LIB, KOHA_CONF, ExecStart, and SyslogIdentifier
all appear to be correctly filled in

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
David Cook 10 months ago
committed by Jonathan Druart
parent
commit
21a850a3dc
  1. 1
      Makefile.PL
  2. 17
      etc/koha-worker.service

1
Makefile.PL

@ -662,6 +662,7 @@ my $pl_files = {
'blib/KOHA_CONF_DIR/koha-conf.xml',
'blib/KOHA_CONF_DIR/koha-httpd.conf',
'blib/KOHA_CONF_DIR/log4perl.conf',
'blib/KOHA_CONF_DIR/koha-worker.service',
'blib/ZEBRA_CONF_DIR/etc/default.idx',
'blib/MISC_DIR/koha-install-log'
],

17
etc/koha-worker.service

@ -0,0 +1,17 @@
# koha-worker.service
[Unit]
Description=Koha Task Queue Worker
After=syslog.target network.target
[Service]
Environment=PERL5LIB=__PERL_MODULE_DIR__
Environment=KOHA_CONF=__KOHA_CONF_DIR__/koha-conf.xml
ExecStart=__SCRIPT_DIR__/background_jobs_worker.pl
Restart=on-failure
RestartSec=5s
StartLimitBurst=3
StartLimitInterval=60
SyslogIdentifier=koha-worker-__DB_NAME__
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save