Koha-clms/debian/systemd
Martin Renvoize 5562b26bb0
Bug 40901: (QA follow-up) Fix Z39.50 option expansion and honour the indexer defaults
Two problems in how the units consume koha-generate-env's output:

1. koha-z3950@.service passed ${Z3950_ADDITIONAL_OPTS}. In systemd unit
   files "${VAR}" always expands to exactly one argument, and to a single
   empty argument when the variable is empty; only unbraced "$VAR" is
   word-split. So a configured value like "--add-item-status k -t 5"
   reached z3950_responder.pl as one unknown option, and the default
   empty value reached it as a "" listener address. Verified with
   systemd-run: ${X}="--a --b" gives ["--a --b"], ${Y}="" gives [""],
   $X gives ["--a"] ["--b"]. Use the unbraced form.

2. koha-indexer@.service hardcoded rebuild_zebra.pl -daemon -sleep,
   ignoring ALTERNATE_INDEXER_DAEMON and INDEXER_PARAMS from
   /etc/default/koha-common that the SysV path honours. koha-generate-env
   now resolves INDEXER_DAEMON and INDEXER_PARAMS exactly like
   koha-indexer and the unit runs them through /usr/bin/env, so any
   configured indexer works.

koha-generate-env is also tightened up: numeric values are validated
and fall back to their defaults, every value is forced onto one line
without quote characters so the EnvironmentFile always parses, the
debug_mode test matches is_debug_mode, Z3950_ADDITIONAL_OPTS is read
from /etc/default/koha-common first (as before this patchset), the
Z39.50 config dir uses the same config.xml test as is_z3950_enabled,
the env dir is created with the instance's ownership if it does not
exist yet, and unknown services get an empty env file instead of a
chmod failure. The responder is invoked through /usr/bin/perl like the
other Perl daemons.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-29 09:02:31 +00:00
..
koha-common.service Bug 40901: (QA follow-up) Make koha-common.service a dependency-free shim 2026-09-29 09:02:30 +00:00
koha-create-dirs@.service Bug 40901: (follow-up) Order per-component units after koha-create-dirs 2026-09-29 09:01:56 +00:00
koha-es-indexer@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-indexer@.service Bug 40901: (QA follow-up) Fix Z39.50 option expansion and honour the indexer defaults 2026-09-29 09:02:31 +00:00
koha-plack@.service Bug 40901: (QA follow-up) Use /run instead of legacy /var/run in unit files 2026-09-29 09:02:19 +00:00
koha-sip@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-systemd-ctl Bug 40901: (QA follow-up) Move ES indexer re-discovery into koha-systemd-ctl 2026-09-29 09:02:17 +00:00
koha-worker-long_tasks@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-worker@.service Bug 40901: (follow-up) Systemd hardening 2026-09-29 09:01:59 +00:00
koha-z3950@.service Bug 40901: (QA follow-up) Fix Z39.50 option expansion and honour the indexer defaults 2026-09-29 09:02:31 +00:00
koha-zebra@.service Bug 40901: (QA follow-up) Use /run instead of legacy /var/run in unit files 2026-09-29 09:02:19 +00:00
koha.target Bug 40901: Add koha-systemd package with native systemd units 2026-09-29 09:01:21 +00:00
koha@.target Bug 40901: (follow-up) Drop redundant StopWhenUnneeded on koha@.target 2026-09-29 09:01:58 +00:00