How to stop unwanted servrices during boot

Markus Hubig ubuntu at pot.ath.cx
Tue Nov 16 19:39:08 UTC 2004


On Tue, 16 Nov 2004, Le grand pinguin wrote:

> On Tue, Nov 16, 2004 at 11:02:20AM -0500, Shawn Milo wrote:
>
> > chmod -x rc.samba
> 
> No, no, no --- pleeease don't provide such ugly hacks! There's a
> canonical way of doing this for sysv init scripts: create or remove a
> link from the script (in /etc/init.d) to the runlevel directory
> (/ect/rcN.d where N is the number of the runlevel). If the name of the
> link starts with an 'S' then the service is started for that runlevel,
> if it starts with a 'K' the service is stopped ("killed").  Now, for all
> these wanabee-sysadmins: if even that is too complicated Debian (and
> hence Ubuntu) has a CL program called 'update-rc.d' which will happily
> handle the link creation/removal for you /see other poster's comments).
> Why on earth would anyone want to do the same task in such a contieved
> way?

Someone told that if you remove links with "update-rc.d" they are
restored by every update of the providing package. "update-rc.d" is
only used in package installation scripts, and not designed for this
kind of runlevel management.

| http://www.ubuntulinux.org/wiki/UbuntuBootupHowto

And the problem with manually removing rcX.d links is that they are at
different places/runlevels ...

| ls /etc/rc*.d/S14ppp
| /etc/rc2.d/S14ppp  /etc/rc3.d/S14ppp  /etc/rc4.d/S14ppp  /etc/rc5.d/S14ppp

... and nobody can remember the startup/shutdown priority to restore the
links. This is an very user-unfriendy way of managing the runlevels.

The 'chmod -x' is my preferred way of doing this at the momment. But I
think we need much smarter init.d-scripts to handel this via files in
/etc/default/my-init.d-script.

There should also be some kind of "dependency" handling ... and that
stuff is already included in the LSB 2.0.1 we already using!

| http://refspecs.freestandards.org/LSB_2.0.1/LSB-Core/LSB-Core/sysinit.html

So IMHO the fastest way that "just works" for now is the "chmod -x" thing.
Maybe with the /etc/rc /etc/rcS patches to avoid the "init can't exec ..."
errors at startup. When we have something better everything is easily fixed
by a simple "chmod +x /etc/init.d/*".
 
   - Markus

-- 
Wirklich reich ist,
wer mehr Träume in seiner Seele hat,
als die Realität zerstören kann.
    -- (unbekannt)




More information about the ubuntu-users mailing list