[debhelper-devel] Bug#879727: debhelper: dh_systemd_start script fails to start new units when an existing unit is updated (LP#1707880)

Felipe Sateler fsateler at debian.org
Fri Oct 27 00:43:36 UTC 2017


On Wed, Oct 25, 2017 at 3:19 AM, Niels Thykier <niels at thykier.net> wrote:

> Imho, there should be an extra snippet in apt.postinst which does this:
>
> if [ -d /run/systemd/system ]; then
>  if dpkg --compare $2 with version that introduces apt-daily-upgrade.timer; then
>          deb-systemd-invoke start apt-daily-upgrade.timer >/dev/null || true
>  fi
> fi
> """
>
> I am not entirely sure this can be solved in debhelper, so we may need
> some extra functionality from deb-systemd-invoke (as debhelper does
> not know when a service was introduced and when it wasn't).

Indeed, debhelper can't know. I see the following options:

1. Change the autoscripts to use restart instead of try-restart.
deb-systemd-invoke will still not start static/disabled units, but any
not running unit would start. This is basically how the
sysvinit/invoke-rc.d integration works.
2. Add an option to dh_systemd_start (and dh_installsystemd) to inject
the extra snippet, a la dpkg-maintscript-helper
3. Keep the installed units in a statefile somewhere so that
deb-systemd-invoke can do the right thing then told to try-restart a
new unit.

I think I prefer option 1, as it requires the least amount of work.
Tracking the versions a unit was shipped in sounds like over
engineering to me.

-- 

Saludos,
Felipe Sateler




More information about the debhelper-devel mailing list