Making it possible to uninstall initscripts / insserv and facilities
Martin Pitt
mpitt at debian.org
Wed Nov 25 06:47:48 GMT 2015
Hello all,
Michael Biebl [2015-11-24 22:28 +0100]:
> Am 24.11.2015 um 22:25 schrieb Petter Reinholdtsen:
> > [Felipe Sateler]
> >> That would potentially leave initscripts with wrong ordering, thus
> >> breaking a boot back to sysvinit (via syvinit package).
> >
> > My guess is that this would not happen if the initscripts package is
> > installed before trying to boot using sysvinit, which I suspect is a
> > requirement. The initscripts postinst script calls update-rc.d which
> > would call insserv to fix the ordering. Is my guess wrong?
>
> Afaiu, Felipe's point was, that initscripts could be installed, but
> systemd the active PID 1.
> So switching to sysvinit as active init would not necessarily re-trigger
> a insserv run.
> So we shouldn't make it dependend on what is the active PID 1, but
> whether initscripts is installed.
Agreed. If you are under systemd without initscripts, then the
generated priorities would be wrong (but that's okay as systemd does
not use them), and if you then install sysvinit this would install
initscripts too as a dependency, and their postinst would run insserv
again to compute correct sysv priorities.
If OTOH you are under systemd with initscripts installed, then nothing
would change at all, that's the status quo. insserv would always be
able to compute correct sysv priorities.
The main thing I'm not sure about is what to use as a flag file to see
whether initscripts is installed. "dpkg -s" is rather expensive,
/lib/init/vars.sh is an internal implementation detail which might
change, and pretty much all other files are conffiles. I guess
checking whether /etc/init.d/checkroot.sh exists should be good
enough, and if people remove it they get to keep both halves as doing
so in an actual sysvinit system would break insserv pretty hard
anyway.
So, I like Felipe's proposal in general. insserv already has a --force
flag which should work as-is, so AFAICS we wouldn't need to modify it
at all. We only need to change update-rc.d do do something like
if [ ! -e /etc/init.d/checkroot.sh ] && [ -d /run/systemd/system ]; then
call insserv with --force
else
call insserv normally
fi
?
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
More information about the Pkg-systemd-maintainers
mailing list