/lib/init/vars.sh returns non-zero for non-error status
Bug #83741 reported by
Noah Slater
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sysvinit (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: initscripts
Sourcing /lib/init/vars.sh returns non-zero from the following line:
[ "$INIT_VERBOSE" ] && VERBOSE=
Not having $INIT_VERBOSE set IS NOT an error condition and "|| true" should be appended to this last line.
Any init scripts sourcing this file with "set -e" will fail.
Related branches
Changed in sysvinit: | |
importance: | Undecided → Medium |
status: | Unconfirmed → In Progress |
Changed in sysvinit: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
Any shells that failed due to this are in violation of POSIX, as 'set -e' is not supposed to cause a failure due to the first part of an AND list. See http:// www.opengroup. org/onlinepubs/ 009695399/ utilities/ set.html:
-e
When this option is on, if a simple command fails for any of the reasons listed in Consequences of Shell Errors or returns an exit status value >0, and is not part of the compound list following a while, until, or if keyword, and is not a part of an AND or OR list, and is not a pipeline preceded by the ! reserved word, then the shell shall immediately exit.