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

Bug#562506: init scripts should not use set -e

Steve Langasek <vorlon@debian.org> writes:

> I don't think that 'set -e' is wrong for init scripts, so much as the
> LSB init script interfaces' requirement of 'set +e' is an unfortunate
> design flaw.  Still, as many init scripts are using
> /lib/lsb/init-functions nowadays, I think it's worth calling this out in
> Policy as an exception.

> We should explicitly qualify this in terms of /lib/lsb/init-functions
> being an *optional* library that init scripts *may* use.

That seems reasonable, although I think we should also point out the
problems with using set -e when starting a daemon, namely that you need to
be sure to wrap the start-stop-daemon invocation in a conditional so that
you can properly report errors, rather than just letting the init script

Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>

Reply to: