How best to transition a package from shadow service control
Andrew Bower
andrew at bower.uk
Mon Sep 1 08:30:17 BST 2025
A common practice by older initscripts is to operate a shadow form of
service control by gating service startup on a variable in /etc/default
instead of allowing the symlink farm exclusively to govern service
enablement under the management of update-rc.d.
This practice is contrary to Debian policy 9.3.3.1[1] and as other init
systems introduce native service definitions they often do not adopt the
same gating variable, leading to diverging behaviour for the same
configuration depending on which init system is in control.
What do we think would be the best way to transition a package from
using shadow service control?
This could be achieved in the maintscripts but that is incompatible with
using dh_installinit etc. (which we would really rather use if we
possibly can) because it involves invoking update-rc.d twice: once to
reflect any pre-existing configuration in the environment file on
upgrade and then again by the helper code to attempt to set defaults on
a fresh installation. Lintian will pick this up.
Is there a good recipe for achieving this or is user notification
better? Or should the behaviour just change unannounced? Or should we
keep the mess and potentially increase divergence when a systemd unit
gets introduced that ignores these variables (also, likely unannounced)?
I suspect the correct technical answer is to do the simplest thing and
invoke dh_installinit with the appropriate default enablement and not
attempt to translate the old setting but to notify the user.
There's a question of whether this would meet the notability bar for
including in NEWS. If the user were notified selectively when the new
default was different from their old variable setting, what would be the
best way to enact that notification?
Thanks for any thoughts on best practice!
Andrew
[1] https://www.debian.org/doc/debian-policy/ch-opersys.html#managing-the-links
More information about the Debian-init-diversity
mailing list