<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, May 16, 2018 at 8:34 AM 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">Felipe Sateler:<br>
> [...]<br>
> <br>
> I think the entanglement can be removed by runtime checking of the unit.<br>
> <br>
> 1. Swap the order of installinit and installsystemd so systemd acts first.<br>
<br>
(Moved related argument up)<br>
> Step one is needed in case the compatibility symlink is created at<br>
> systemd-enable time (via Alias)<br>
><br>
<br>
Just to confirm, we just need "d-s-h enable <service>" from<br>
dh_installsystemd to run before the snippet below for the same service,<br>
correct?<br></blockquote><div><br></div><div>That's what I had in mind, yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If so, then we have an alternative method for handling that besides<br>
re-ordering the helpers. That would have the advantage of also working<br>
if people call dh_installinit and dh_installsystemd in a different order<br>
than we expect.<br></blockquote><div><br></div><div>Well, dh helpers are already order dependent so I wouldn't loose much sleep over it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> 2. Have the installinit snippet do:<br>
> <br>
> if [ -d /run/systemd/system ] && [ "/etc/init.d/#SCRIPT" != "$(systemctl<br>
> show --value --property SourcePath #SCRIPT#.service)" ] ; then<br>
> # do nothing<br>
> else<br>
> invoke-rc.d #SCRIPT# start || #ERROR_HANDLER#<br>
> fi<br>
> <br>
> This checking could also be moved into invoke-rc.d via some flag. What do<br>
> you think?<br>
> <br>
<br>
I think it would be best if that logic was handled by invoke-rc.d. In<br>
case that logic need to be updated for some reason, then it is a lot<br>
easier to just update update-rc.d than thousands of maintscripts.<br></blockquote><div><br></div><div>Agreed.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can you handle the update-rc.d side or should I file a bug against<br>
init-system-helpers?<br></blockquote><div> </div><div>I'd like opinions from the rest of pkg-systemd first. Michael, what do you think?</div><div><br></div><div>Another thing that came to mind is that the above check won't work in a chroot. But invoke-rc.d already denies chroot execution without policy-rc.d, and systemd execution has no chance of working either (systemctl rejects calls when it detects it is chrooted), so perhaps this is enough of a corner case to be pushed into the future when someone bumps into it.</div><div><br></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>Saludos,<br>Felipe Sateler</div></div>