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

Debian, daemons and runlevels (was: Re: X and runlevels)



On Mon, 04 Sep 2000, Paul Slootman wrote:
> On Mon 04 Sep 2000, Ethan Benson wrote:
> 
> It's unfortunate that there's no easy way to find the current runlevel
> (the usual "who -r" from Solaris etc. doesn't work), otherwise this
> piece of code could be used:
> 
> 	RL=`who -r`
> 	if [ -x /etc/rc$RC.d/S??$PKGNAME ]; then
> 		/etc/rc$RC.d/S??$PKGNAME start
> 	fi
> 
> That's ignoring file-rc, unfortunately. Is there an easy way of
> determining whether a certain init.d script should be started in
> the current runlevel that works also with file-rc ?

I was going to tack this sooner or later (the "trust us, we KNOW you want
the daemons to start always" current state of almost all daemon packages
annoys me to no end, and from past flamewars I know I'm not the only one), I
think I even warned a few newbies in -user two days ago about this :-)

The solution is to *force* all daemon packages to never start a daemon out
of its intended runlevel, be it during first install or upgrades (I think
this probably requires a policy change). I'd even say this should be a goal
for woody, unless we're going to try to get woody out of the door very fast.

This would be managed through a simple (for sysvinit. I don't believe it'd
be very complex for file-rc either, but I didn't check), standard
script/program added to the sysvinit and file-rc packages (and any other
future packages of the same sort) which allows a script to query if a
certain init.d script should be started [in the current runlevel].

This assumes that the name of a daemon's init.d file is the generic ID for
that daemon, but this is the current policy for Debian anyway (it's what you
feed to update-rc.d).

I should check if the LSB tries to do something like this in a
non-braindamaged way, too... just in case.

This could (IMHO should, but lets not go there) be expanded later to allow
the administrator a bit more control over daemons being started on first
install (before he reviewed config files, for example). As long as
update-rc.d is called before running this script during package installs and
upgrades, it would setup the default runlevels the daemon is supposed to run
on.  There would be no changes in behaviour of a standard debian install.

Any comments?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

Attachment: pgpZTEhBEu9Kz.pgp
Description: PGP signature


Reply to: