<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, May 13, 2018 at 1:54 PM Niels Thykier <<a href="mailto:niels@thykier.net">niels@thykier.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Control: tags -1 -patch<br>
<br>
Felipe Sateler:<br>
> On Sun, May 13, 2018 at 11:34 AM Niels Thykier <<a href="mailto:niels@thykier.net" target="_blank">niels@thykier.net</a>> wrote:<br>
> <br>
> [...]<br>
> <br>
> There is one case where I think things go wrong (but I haven't tested): A<br>
> package including only an init script will not run invoke-rc.d but it won't<br>
> have a dh_installsystemd snippet either, so the service won't get started<br>
> on installation.<br>
> <br>
> <br>
> <br>
<br>
That sounds like it is true.  However, it also seems to imply that<br>
dh_installsystemd and dh_installinit must forever be tangled some how.<br>
If true, that is very much unfortunate as it makes the interaction a lot<br>
more complicated than it should be (case in point, this bug is caused<br>
exactly by these two commands being tangled).<br>
<br>
Do you see a solution for this, where dh_installsystemd and<br>
dh_installinit can become independent/unaware of each other?<br>
Alternatively, should we merge them into a single helper instead?<br></blockquote><div><br></div><div>I think the entanglement can be removed by runtime checking of the unit.</div><div><br></div><div>1. Swap the order of installinit and installsystemd so systemd acts first.</div><div>2. Have the installinit snippet do:</div><div><br></div><div>if [ -d /run/systemd/system ] && [ "/etc/init.d/#SCRIPT" != "$(systemctl show --value --property SourcePath #SCRIPT#.service)" ] ; then</div><div>  # do nothing</div><div>else</div><div>  invoke-rc.d #SCRIPT# start || #ERROR_HANDLER#</div><div>fi</div><div><br></div><div>This checking could also be moved into invoke-rc.d via some flag. What do you think?</div></div><div><br></div><div>Step one is needed in case the compatibility symlink is created at systemd-enable time (via Alias)</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>Saludos,<br>Felipe Sateler</div></div>