Bug#887904: RFR: Make dh_installinit and dh_installsystemd debhelper autoscript snippets independent in c12 (Was: Re: Bug#887904: dh_installsystemd will unmask services *after* an attempt to start them)

Felipe Sateler fsateler at debian.org
Tue May 15 00:08:20 BST 2018


On Sun, May 13, 2018 at 1:54 PM Niels Thykier <niels at thykier.net> wrote:

> Control: tags -1 -patch
>
> Felipe Sateler:
> > On Sun, May 13, 2018 at 11:34 AM Niels Thykier <niels at thykier.net>
> wrote:
> >
> > [...]
> >
> > There is one case where I think things go wrong (but I haven't tested): A
> > package including only an init script will not run invoke-rc.d but it
> won't
> > have a dh_installsystemd snippet either, so the service won't get started
> > on installation.
> >
> >
> >
>
> That sounds like it is true.  However, it also seems to imply that
> dh_installsystemd and dh_installinit must forever be tangled some how.
> If true, that is very much unfortunate as it makes the interaction a lot
> more complicated than it should be (case in point, this bug is caused
> exactly by these two commands being tangled).
>
> Do you see a solution for this, where dh_installsystemd and
> dh_installinit can become independent/unaware of each other?
> Alternatively, should we merge them into a single helper instead?
>

I think the entanglement can be removed by runtime checking of the unit.

1. Swap the order of installinit and installsystemd so systemd acts first.
2. Have the installinit snippet do:

if [ -d /run/systemd/system ] && [ "/etc/init.d/#SCRIPT" != "$(systemctl
show --value --property SourcePath #SCRIPT#.service)" ] ; then
  # do nothing
else
  invoke-rc.d #SCRIPT# start || #ERROR_HANDLER#
fi

This checking could also be moved into invoke-rc.d via some flag. What do
you think?

Step one is needed in case the compatibility symlink is created at
systemd-enable time (via Alias)
-- 

Saludos,
Felipe Sateler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20180514/2c3c84bb/attachment-0002.html>


More information about the Pkg-systemd-maintainers mailing list