[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: prog. end of the boot ? rc.local



Christopher Swingley <cswingle@iarc.uaf.edu> writes:

> 
> Debian uses the /etc/rc0.d -> /etc/rc6.d folders for links to actual
> scripts in /etc/init.d.  When the boot process reaches a particular run
> level (say level 2), it processes all the links in the /etc/rc2.d 
> directory, in order.  If the link starts with a K then it executes the
> link with the stop parameter (meaning it runs the same scripts in ../init.d
> with stop).  If the link starts with an S then it sends the option start.
> If you look at the actual scripts in /etc/init.d you can see that they
> use case logic based on the option passed to decide whether to start
> or stop daemons.  In general, rc0.d, rc1.d and rc6.d contain largely K
> links because these are the run levels for shutting down the system or
> rebooting it.  rc2 - rc5 are the run levels where stuff gets started.
> 
> So, to answer your question, the way I stop the crap from running is
> to either uninstall the package, or simply change the name of each link
> so that it starts with DISABLE instead of K or S.  When the system is
> booting, or shutting down, it ignores all links that don't start with K
> or S, so this effectively disables the daemon without removing the
> script or the binary in case you want to run it later.  You'll have to
> either figure out what your run levels are, or just move all the links
> in the directories rc0 - rc6.
> 
> To start a new service, or do something that you would have done in
> rc.local in RedHat, write a script that knows about start and stop,
> put it into /etc/init.d, and then link it with a K or and S in all
> the rc directories.  You can decide where your script will run by
> choosing the number appropriately.  (i.e. if you compiled Apache
> yourself and want it to run, you should probably make the script link
> such that it starts after your network initialization scripts or
> it might hang.  If you look at the way the rc directories are ordered,
> you'll see what I mean.

     See man update-rc.d to learn how to manipulate the symlinks in
rc?.d more easily.  Manipulating them by hand is a pain.

Bob
-- 
   _
  |_)  _  |_       Robert D. Hilliard    <hilliard@flinet.com>
  |_) (_) |_)      Palm City, FL  USA    PGP Key ID: A8E40EB9


Reply to: