Bug 40901: (QA follow-up) Install the SysV init script through dh_installinit
debhelper treats debian/<package>.init as that package's init script, so koha-sysv would have shipped /etc/init.d/koha-sysv (with generated update-rc.d and invoke-rc.d handling) as well as the .install-copied /etc/init.d/koha-common (with none). That meant two identical init scripts, two generated units on systemd hosts, and on a fresh non-systemd install the "update-rc.d koha-common disable" call in the postinst aborting with "no runlevel symlinks to modify" because nothing had ever created them. Rename the script to debian/koha-sysv.koha-common.init and run dh_installinit --name=koha-common for koha-sysv. debhelper now installs it as /etc/init.d/koha-common, registers the rc.d links, starts it on install, restarts it on upgrade, stops it on removal and removes the links on purge, which is exactly what the old koha-common package did. The hand-written prerm/postrm and the Bug 18250 disable/enable dance (a one-off link reshuffle from 2017 that is a no-op under dependency-based boot) are dropped in favour of the generated code. 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>
This commit is contained in:
parent
b8b064bf40
commit
760641c550
|
|
@ -1 +0,0 @@
|
|||
debian/koha-sysv.init etc/init.d/koha-common
|
||||
|
|
@ -2,19 +2,10 @@
|
|||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# Bug 18250: Correct startup order of koha-common and memcached.
|
||||
# On non-systemd systems only: force the rc.d ordering.
|
||||
# On systemd hosts, systemd-sysv-generator wraps /etc/init.d/koha-common
|
||||
# as koha-common.service and honors the rc.d symlinks; no manual
|
||||
# enable needed.
|
||||
if [ ! -d /run/systemd/system ]; then
|
||||
update-rc.d koha-common disable
|
||||
update-rc.d koha-common enable
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# /etc/init.d/koha-common is installed by dh_installinit --name=koha-common
|
||||
# (see debian/rules), which also generates the update-rc.d / invoke-rc.d
|
||||
# handling below. On systemd hosts systemd-sysv-generator wraps the script
|
||||
# as koha-common.service and honours those rc.d links.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
# Disable the service on systemd systems
|
||||
if [ -d /run/systemd/system ]; then
|
||||
deb-systemd-helper purge koha-common.service >/dev/null || true
|
||||
deb-systemd-helper unmask koha-common.service >/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = "remove" ]; then
|
||||
# Stop the service
|
||||
if [ -d /run/systemd/system ]; then
|
||||
deb-systemd-invoke stop koha-common.service >/dev/null || true
|
||||
else
|
||||
invoke-rc.d koha-common stop || true
|
||||
fi
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
|
@ -8,6 +8,13 @@ export PERL_MM_USE_DEFAULT=1
|
|||
%:
|
||||
dh $@ --fail-missing --with bash-completion
|
||||
|
||||
# koha-sysv ships the SysV init script under its historical name so that
|
||||
# dpkg hands /etc/init.d/koha-common over from the old monolithic koha-common
|
||||
# package and debhelper generates the matching update-rc.d/invoke-rc.d code.
|
||||
override_dh_installinit:
|
||||
dh_installinit -pkoha-sysv --name=koha-common
|
||||
dh_installinit --remaining-packages
|
||||
|
||||
override_dh_gencontrol:
|
||||
debian/bd-to-depends >> debian/koha-common.substvars
|
||||
debian/bd-to-depends >> debian/koha-core.substvars
|
||||
|
|
|
|||
Loading…
Reference in New Issue