Making it possible to uninstall initscripts / insserv and facilities
Felipe Sateler
fsateler at debian.org
Tue Nov 24 23:06:56 GMT 2015
On 24 November 2015 at 18:57, Felipe Sateler <fsateler at debian.org> wrote:
> On 24 November 2015 at 18:28, Michael Biebl <biebl at debian.org> wrote:
>> 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.
>
> Exactly, and the added --force would mask a bug somewhere in the init scripts.
>
>
>> What check did you have in mind here? Testing for a (conf)file shipped
>> by the initscripts package?
>
> Right. Either that or shelling out to dpkg-query, but testing for
> /etc/init.d/mountkernfs.sh (the most depended upon service) would be
> good as well.
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";
--
Saludos,
Felipe Sateler
More information about the Pkg-systemd-maintainers
mailing list