El Fri, 25 de Jul 2014 a las 3:42 PM, Russ Allbery <r...@debian.org>
escribió:
Cameron Norman <camerontnor...@gmail.com> writes:
Oh this is easy. The init script calls s-s-d and does not check the
return
code (so always exits 0). I am just going to use set -e in the init
script, only a couple tweaks are needed.
Please don't use set -e in init scripts. See Policy 9.3.2:
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. For init.d scripts, it's often easier to not
use
set -e and instead check the result of each command separately.
Not mentioned there is another problem, namely that LSB mandates
particular exit codes for particular conditions in init scripts, and
set
-e will not produce the correct exit codes.
I thought that start-stop-daemon (and status_of_proc) returned the
correct codes, and whatever it returns you can relay / let the shell
catch? The script is here
(https://github.com/cgmanager/cgmanager/pull/14/files), if you wanted
to take a look.
Best,
--
Cameron Norman