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

Re: Daemon init scripts and apt-get [was: Re: red worm amusement]



Marko Kreen <marko@l-t.ee> writes:

> > If the ``do I run service X'' check is done in rcS it means that each
> > init.d script is either on or off.  This would eliminate the
> > possibility of having more than one check in a script -- for example,
> > it would be logical to configure the existing Debian networking script
> > with chkconfig options for spoofprotect, syncookies, and ip_forward.
> > This wouldn't be possible if the chkconfig is done in rcS.
> 
> Well, rcS could do overall 'do I run anything from this package' check,
> then init script could check lesser variables, but maybe this gets
> confusing.

I think it's easier (or at least more obvious) to put check in the
init.d scripts.  It also makes things optional -- package maintainers
can add support for (and dependence on) chkconfig on an individual
basis.


> > IRIX actually leverages this significantly -- there are a dozen or so
> > different chkconfig controls in the IRIX networking script used to
> > enable/disable starting of things like nfs, autofs, timed, gated, etc.
> 
> Well, we have basically one init script per package.  Now I want
> state, that _nothing_ from this package gets started.  Do I need
> examine the init script then one-by-one disable all vars?

Nope, you would likely have a hierarchy of checks in scripts that
start more than one service.

To use IRIX as an example, chkconfig'ing ``gated'' won't prevent the
other networking daemons from starting.  But chkconfig'ing ``network''
off prevents all the networking daemons (including gated) from
starting.

This also allows logical dependencies among related init.d scripts --
for instance there's no point in starting a service that depends on
portmap if portmap isn't running.  With a chkconfig like system this
type of dependence is as simple as two chkconfigs in an && clause.



> As in Debian most of services are nicely split up, this should
> not matter.

Yes and no.  The init.d scripts are indeed much better split up in
Debian than in IRIX.  They need to be, since enabling/disabling a
service under Debian is generally done by not installing it or
adding/removing rc?.d links.  IRIX doesn't need to split out services
since the chkconfig system is available to control what is/isn't
started.

But in Debian there are still some individual options that require
editing of init.d scripts to enable or disable (see the mountnfs.sh
and networking scripts for examples).  Whether or not this makes
adding a system like chkconfig ``worth the trouble'' is another
question....  :-)

-- 

/*  Dale Southard Jr.  dsouth@llnl.gov  925-422-1463, fax 422-9429  */
/*  Computer Scientist, Accelerated Strategic Computing Initiative  */
/*  L-073,  Lawrence Livermore National Lab,  Livermore CA   94551  */
/*  AFF/I, SL/I, T/I, D-11216, Sr. Rig --- I'd rather be skydiving  */



Reply to: