Canonical method to locally disable an init script?

Lorenzo plorenzo at disroot.org
Mon Nov 23 20:05:44 GMT 2020


On 11/23/20 8:19 PM, Thorsten Glaser wrote:
> Apparently I’m not using the correct way to disable that script.
> But which of the many ways found (most recent ’net founds indicate
> update-rc.d remove, older ones show update-rc.d disable or even
> defaults disable) is the *correct* one?
>
> Perhaps I even accidentally found a bug, update-rc.d remove is
> right, used to work, but with insserv the symlinks are forcibly
> added now?
>
> Thanks in advance,
> //mirabilos
update-rc.d <initscriptname> disable

should create KNNinitscriptname links in all runlevels (and remove
SNNinitscriptname links)
This way when you update the package your preference is preserved.
You can test this by running

'update-rc.d <initscriptname> defaults which should not replace K links
with S links
also you also can test by running

'invoke-rc.d <initscriptname> start

which, as long as there are K links, is not supposed to start your service.

If one of the two above is not true then there is a bug in
init-system-helpers package.
Note that 'update-rc.d remove |  defaults | default-disable ' and all
invoke-rc.d commands are
usually called in maintscripts, not by the user.
(The user is not supposed to bother with insserv too)

Lorenzo





More information about the Debian-init-diversity mailing list