Bug 40901: (follow-up) koha-create enables koha@<inst>.target on systemd

Without this, freshly-created instances on a koha-systemd host do
not auto-start at next boot.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Kyle M Hall 2026-05-08 12:44:48 -04:00 committed by Pedro Amorim
parent 9ce9a07460
commit 8023b38202
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 8 additions and 0 deletions

View File

@ -922,6 +922,14 @@ then
koha-indexer --start "$name"
fi
# systemd-only: enable the per-instance target and the
# create-dirs oneshot so the instance comes back up on reboot.
if [ "$(koha_init_backend)" = "systemd" ]; then
systemctl enable koha-create-dirs@${name}.service 2>/dev/null || true
systemctl enable koha@${name}.target 2>/dev/null || true
systemctl start koha.target 2>/dev/null || true
fi
if [ "$CLO_LETSENCRYPT" = "yes" ]; then
# Get letsencrypt certificates
letsencrypt_instance