Re: Daemon init scripts and apt-get [was: Re: red worm amusement]
On Wed, Aug 08, 2001 at 02:56:46PM -0700, Mike Fedyk wrote:
> On Wed, Aug 08, 2001 at 08:44:50PM +0200, Marko Kreen wrote:
> > On Wed, Jul 25, 2001 at 11:05:25AM -0700, Dale Southard wrote:
> > > Why not use something like the IRIX ``chkconfig'' system: Provide a
> > > simple program that takes the ``name'' of a service and then checks an
> > > external file/files for ``on'' or off status of each service, and
> > > returns 0 if on, 1 if off. Then have each init.d script do something
> > > like:
> > >
> > > case "$1" in
> > > 'start')
> > > if /etc/chkconfig myservice; then
> > > ...
> > > start myservice
> > > ...
> > > fi
> >
> > Would not it be better to put this login in rcS script? That
> > way the services can be manually started if needed (eg. for
> > testing).
> >
>
> If you want to login before services start in single user mode then change:
Uh. Ofcourse I meant 'code'. I have no idea how the word
'login' got there...
Dale proposed that each init script checks itself whether it
needs to be started, from some central location. I think this
is not good, it takes away flexibility. IMHO it would be better
if only /etc/init.d/rc (& rcS) checks whether a service should be
auto-started on boot. That way the responsibility is also
divided better, init-script's business is to start a service
and rc/rcS business is start boot-time services.
One easy hack woud be to replace '-f' with '-x' in following
code in rc, rcS:
[ ! -f "$i" ] && continue
then later you can 'chmod -x' init scripts. Problem with
this is that on upgrade your 'settings' will be lost.
Better would be to put the chkconfig into those loops.
--
marko
Reply to: