[Pkg-sysvinit-devel] Re: Fixing hwclock.sh

Henrique de Moraes Holschuh hmh at debian.org
Fri Jan 6 14:27:39 UTC 2006


I am posting this one to the list, I hope you don't mind.

On Fri, 06 Jan 2006, Thomas Hood wrote:
> I don't think that any of the .sh initscripts needs to modify the sourcer's
> environment.  AIUI some scripts are .sh scripts for speed reasons: each is

Some might. OTOH, if any modifications they do are lost to other stuff init
runs such as the vt gettys, then we could just as well drop that idea and
use sourcing just for the speed effect.

This does mean that any sourced scripts needing to set variables might well
need to start subshells, or play "restore on exit" games, which are a sad
thing to have everywhere.

IMHO, if we want faster initscripts, we should try to use dash (posh is not
a real choice unless we do it in a case-by-case basis) to run them when
possible (i.e. on our own non-sourced scripts, and on everything that is
sourced).  Maybe even depending on dash is possible (but that would bump
dash all the way up from optional to required, and it might even make it
essential (I didn't think about that angle yet), so we would _definately_
need to talk this out in d-devel and the dash maintainer).

There is another way that doesn't require a dependency: modify sysv-rc's
(and ask other initscript systems to do so as well) /etc/init.d/rc (and rcS,
which is the same thing for sysv-rc in Debian) to use dash when available to
run the initscripts in shell mode (.sh scripts).

Those of us that are courageous (or foolhardy) enough to use dash as /bin/sh
already know how much faster things get.  But we also get to experience
breakage due to borked maintainer scripts at the worst possible times :)

> (Currently .sh scripts are not sourced, but this is bug #339955.)  Not
> creating new processes speeds up boot time on low-memory systems, I hear.

We have to compromise somewhere.  It may not be possible to source
everything, and there will be times where sourcing is not our best interest
due to complexity or resilience reasons.

We *cannot* tolerate the whole boot crashing because of a sourced script
screwing up, for example :(  Is there a way to source initscripts and still
tolerate broken initscripts without it doing nasty things to /etc/init.d/rc
like causing it to _die_ ?

-- 
  "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



More information about the Pkg-sysvinit-devel mailing list