On Sun, May 13, 2018 at 1:54 PM Niels Thykier <ni...@thykier.net> wrote:
> Control: tags -1 -patch > > Felipe Sateler: > > On Sun, May 13, 2018 at 11:34 AM Niels Thykier <ni...@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