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

Bug#20373: PROPOSED] shouldn't start init scripts in wrong runlevel



> On policy, Piotr Roszatycki <dexter@fnet.pl> wrote:
> > > (That is, we should check whether /etc/rcN.d/{S,K}??script exists
> > > where N is the current runlevel and start or stop the script
> > > appropriately if it does -- see the rest of this bugreport for
> > > details.)
> > > 
> > > I second this proposal.
> > 
> > I'm using file-rc package. There is no /etc/rc?.d directories on my Debian
> > system. I've got only /etc/runleves.conf file in place of these dirs.
> > 
> > The Debian Policy doesn't require to exist /etc/rc?.d directories.
> 
> This could get very ugly/messy. I think it wants a script/program to be part
> of dpkg that when passed a /etc/init.d script and an action will check the
> current run level and the /etc/rc?.d dirs or /etc/runleves.conf and run the
> right script if needed. As I said messy. We want the logic to be in
> a seperate
> program and not in EVERY {post,pre}{inst,rm} script that plays with
> /etc/init.d/* files.

You're absolutely right.  Something like:
  /etc/init.d/start-stop-service foobar start
which will only start foobar if it is explicitly listed in the current
runlevel *or in runlevel S* (the latter is important, as services are
only stopped between runlevels if the new runlevel has an explicit
kill script).  Similarly,
  /etc/init.d/start-stop-service foobar stop
will stop the service if it is so listed in the current runlevel.

Then both sysvinit and file-rc provide scripts to perform this
function.  They should be relatively trivial to write, based on the
/etc/init.d/rc scripts.

> Is there some way to make initd think it has just re-entered the current run
> level and so force the appropriate run-level scripts to run? Maybe I
> am thinking
> about this the wrong way.

Probably not -- /etc/init.d/rc is too clever for that: it only
starts new services, that is, those which hadn't been started at the
previous runlevel.

> What about the ordering in /etc/rc?.d is it important, should we not be
> restarting stuff out of order?

I would guess not; these are not facilities being restarted but newly
installed ones.  If there is a desperate problem with this, it should
be dealt with by a Depends: mechanism or the like.

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
        Debian GNU/Linux Developer,  see http://www.debian.org/~jdg


Reply to: