Indeed this isn't related to native systemd units vs. sysvinit scripts.
> honor this historical behavior by making the 'runlevel' command return the target runlevel when called from a systemd unit that's run at boot, even if that target has not yet been reached.
OK, I wasn't aware of that. I'll look into that.
> d.) output of runlevel is stored in RL and then it goes looking for an SLINK or SSLINK (/etc/rc$RL.d/S??apache2 or /etc/rcS.d/S??apache2). Neither of these exist so it exits without starting the service.
To be sure we are talking about the same thing: Surely update-rc.d should run before invoke-rc.d in the postinst, so the links should exist in rc[2345].d/. This is solely about $RL having the wrong value here, not about the links not existing at all, right?
Indeed this isn't related to native systemd units vs. sysvinit scripts.
> honor this historical behavior by making the 'runlevel' command return the target runlevel when called from a systemd unit that's run at boot, even if that target has not yet been reached.
OK, I wasn't aware of that. I'll look into that.
> d.) output of runlevel is stored in RL and then it goes looking for an SLINK or SSLINK (/etc/rc$ RL.d/S? ?apache2 or /etc/rcS. d/S??apache2) . Neither of these exist so it exits without starting the service.
To be sure we are talking about the same thing: Surely update-rc.d should run before invoke-rc.d in the postinst, so the links should exist in rc[2345].d/. This is solely about $RL having the wrong value here, not about the links not existing at all, right?