[Koha-bugs] [Bug 26363] Provide a systemd unit file for background_jobs_worker

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Nov 26 01:10:01 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26363

--- Comment #18 from David Cook <dcook at prosentient.com.au> ---
(In reply to Jonathan Druart from comment #17)
> 1. Those 2 lines are not equivalent:
>   debian/templates/koha-worker at .service:SyslogIdentifier=koha-worker_%i
>   etc/koha-worker.service:SyslogIdentifier=koha-worker-__DB_NAME__
> 

That's because koha-worker at .service is a template file. When invoked using
```systemctl start koha-worker at NAME.service```, %i will have NAME in it. This
could be used by koha-create.

For source installs, I was thinking that people would just copy or symlink the
built file from the Koha installation directory to /etc/systemd/system, so
they'd want to have the name hard-coded into the unit file. We could use a
systemd template for source installs too and then just given an instruction to
copy the template to /etc/systemd/system and then use ```systemctl start
koha-worker at NAME.service```. It would make things more consistent.

> 2. Should not it be $instance-koha-worker instead, to match what we have in:
> debian/scripts/koha-functions.sh:    if daemon
> --name="$instancename-koha-worker" \

I don't understand the question. What do you mean by "it" in your question? The
SyslogIdentifier could be done like $instancename-koha-worker, but not the
systemd unit. It needs to start with a set name. 

Here's an example that I use locally already:

systemctl status "koha-mq*"
● koha-mq-scheduler at EXAMPLE.service - Koha Message Queue Work Scheduler
   Loaded: loaded (/etc/systemd/system/koha-mq-scheduler at .service; indirect;
vendor preset: enabled)
   Active: active (running) since Sun 2020-11-22 19:33:35 AEDT; 3 days ago
 Main PID: 23226 (mq_scheduler.pl)
    Tasks: 1 (limit: 4915)
   CGroup:
/system.slice/system-koha\x2dmq\x2dscheduler.slice/koha-mq-scheduler at EXAMPLE.service
           └─23226 /usr/bin/perl
/usr/share/koha/bin/prosentient/mq_scheduler.pl -v

Nov 22 19:33:35 koha1911 systemd[1]: Started Koha Message Queue Work Scheduler.

At the moment, I only have one koha-mq-scheduler unit running on that server,
but if there were others, that systemctl command would've listed them all.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list