Making it possible to uninstall initscripts / insserv and facilities
Martin Pitt
mpitt at debian.org
Wed Nov 25 16:25:41 GMT 2015
Michael Biebl [2015-11-25 16:13 +0100]:
> > Would it be a problem to invoke insserv with -f on remove or disable?
> > It would appear it isn't, as the debhelper autoscripts do || true on
> > failure of update-rc.d remove. If so, the change would be very simple:
> >
> > diff --git a/debian/src/sysv-rc/sbin/update-rc.d
> > b/debian/src/sysv-rc/sbin/update-rc.d
> > index a631021..55cd5b0 100755
> > --- a/debian/src/sysv-rc/sbin/update-rc.d
> > +++ b/debian/src/sysv-rc/sbin/update-rc.d
> > @@ -168,6 +168,10 @@ sub insserv_updatercd {
> >
> > usage("not enough arguments") if ($#args < 1);
> >
> > + # Add force flag if initscripts is not installed
> > + # This enables inistcripts-less systems to not fail when a
> > facility is missing
> > + unshift(@opts, '-f') unless -f '/etc/init.d/mountkernfs.sh';
> > +
> > $scriptname = shift @args;
> > $action = shift @args;
> > my $insserv = "/usr/lib/insserv/insserv";
>
>
> Martin, any objections to this approach in general and this patch
> specifically?
As I wrote I think this is mostly good, but I'd really restrict this
to running under systemd
unshift(@opts, '-f') unless -f '/etc/init.d/mountkernfs.sh' || ! -d '/run/systemd/systemd';
IMHO insserv really ought to fail hard if you remove
/etc/init.d/mountkernfs.sh (or initscripts as a whole) and are
actually running sysvinit.
upstart doesn't need that either, so maybe it can be rewritten using
|| -d /run/sysvinit/init
(or whatever sysvinit's socket was), but then we'd still need to check
e. g. openrc.
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