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

Re: Should Debian use lsb init-functions?

On Wed, 04 May 2005, Thomas Hood wrote:
> I have been looking at the lsb init functions and am beginning to feel
> that they are a bad idea.

Here's how I thought about doing it when I was mucking around with
invoke-rc.d and the initscripts paper:

1. No shell functions at all.  Trap stdout and stderr, and parse that.
2. Group all output from a single initscript if possible
3. Get a proper standard for the stdout/stderr usage and enforce it.

That is very Debian-centric, but we could actually make it work with LSB
quite easily, since any LSB script will already run those functions anyway,
and we can have them do whatever is needed.

> * Converting to lsb init function requires modifying every initscript in
> Debian.

We will have to do this sooner or later, but lets make damn sure we know how
we want to do it first...

> * Every initscript has to read in a file containing a set of function
> definitions, some/most of which the initscript does not use.

The stdout/stderr parsing method kills this problem.

> * The lsb functions don't handle all the kinds of output currently
> produced by initscripts.

And this one :)

> * Success/failure status has to be signalled using a special function,
> whereas this information is (or should be) already available as the exit
> status of the initscript.

And this one :)

> I think it would be better if we simply made rc capture initscripts'
> standard output (and exit status) and formatted it in such a way that
> bootup messages were prettier.

Exactly!  Anyone up for a lets-design-the-next-debian-initscript BOF on

Here's how I envision it might be done:

[init] - [demultiplexer/parellism control] (pipe A) (pipe B)
   |---­ [rc] (connects to pipe A) -- (initscript 1)
   |                               -- (initscript n)
   ----- [logging/GUI] (connects to pipe B)

A quick read on the (now somewhat outdated) initscript paper at
http://people.debian.org/~hmh/, sections 5.3 and 5.4 will explain what I
would use the demultiplexer/parallelism control daemon for.

All output from the initscripts get to the demultiplexer, tagged as
stdout/stderr and the initscript instace responsible for it.

*AND* this does not change init, at all.

  "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

Reply to: