From e62c5d4ef97f7a6704daee29dee10f6302cf246a Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 6 Oct 2020 06:30:56 +0000 Subject: [PATCH] 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 --- Makefile.PL | 1 + etc/koha-worker.service | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 etc/koha-worker.service diff --git a/Makefile.PL b/Makefile.PL index 90d52256c6..4daf9af1ee 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -671,6 +671,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' ], diff --git a/etc/koha-worker.service b/etc/koha-worker.service new file mode 100644 index 0000000000..67a88303eb --- /dev/null +++ b/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 -- 2.11.0