Le 23.02.2012 13:19, Didier 'OdyX' Raboud a écrit : > Hi Bastian, > > Le 23.02.2012 11:41, Bastian Blank a écrit : >> On Thu, Feb 23, 2012 at 11:09:20AM +0100, Didier 'OdyX' Raboud wrote: >>>>> The LSB init script example explicitely stat that you must not use >>>>> "set -e". >>>> Obvious nonsense IMO ... >>> I can't find in which file the "must not use set -e" clause is. >> >> /etc/init.d/skeleton >> >> Okay, this needs to be fixed somehow. I see two possibilities: >> - The maintainer fix the init script by removing set -e. >> - I refer this to the CTTE. > > (...) > a) lsb-base: echo'ing to a /dev/console that EIO's can break unrelated > initscripts > > b) initscripts: /etc/init.d/skeleton wrongly recommends to not "set -e"
I just noticed this issue has already been discussed in #562506 and is now consequently documented in Policy since 3.9.0.0 in [9.3.2] with the following paragraph: Be careful of using set -e in init.d scripts. Writing correct init.d scripts requires accepting various error exit statuses when daemons are already running or already stopped without aborting the init.d script, and common init.d function libraries are not safe to call with set -e in effect[72]. For init.d scripts, it's often easier to not use set -e and instead check the result of each command separately. [9.3.2] http://www.debian.org/doc/debian-policy/ch-opersys.html#s-writing-init [72] /lib/lsb/init-functions, which assists in writing LSB-compliant init scripts, may fail if set -e is in effect and echoing status messages to the console fails, for example. So the eventual fix in initscript would need a policy amendment first, IMHO. Now, as far as I understand the problem (again...), the a) problem above might as well be fixed; I don't know if appending || /bin/true after each echo would be sufficient. Making /lib/lsb/init-functions "set-e"-safe might be worthwhile but we'd need a patch. Opinions ? Cheers, OdyX
signature.asc
Description: OpenPGP digital signature