[Pkg-sysvinit-devel] Re: Fixing hwclock.sh
Thomas Hood
jdthood at yahoo.co.uk
Fri Jan 6 14:39:38 UTC 2006
Henrique de Moraes Holschuh wrote, in part:
> 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.
Yes.
If any script would have to create a subshell in order to protect the sourcer's
environment then it shouldn't be a .sh script.
> (posh is not a real choice unless we do it in a case-by-case basis)
And IIRC posh isn't particularly fast. Its purpose is to test for POSIX
correctness. (And it doesn't do that particularly well since it's too strict
to be used as /bin/sh, given that some Debian maintainers flatly refuse to
make their scripts posh-compatible.)
> 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_ ?
There is no reasonable way. If a sourced script does "exit" then rc exits,
with all the consequences of that.
--
Thomas
More information about the Pkg-sysvinit-devel
mailing list