This one time, at band camp, Yaroslav Halchenko said:
> Hi Stephen,
> 
> Thank you for your feedback and sorry for the delay with my reply.

You're welcome, and no problem, respectively.

> > Second, I am assuming like all good scripts, this is set -e.  So you
> nope -- I removed set -e since 
> /etc/init.d/skeleton
> states:
> # Do NOT "set -e"
> since it would cause the script to fail on any failed call to
> function/command, which it shouldn't do but rather process return value.
> 
> and indeed simple example shows that even if I go with -ne ... || I
> would get early exit from the script if a function returns non-0:

This means that the functions are brain dead, or designed to return
an error code that you have to trap and handle, and you need to wrap
all of them in 'if $function; then ....; fi' or similar.  Brain dead
libraries are no reason to have brain dead programs (although I can see
the temptation).

> But then to enable -e in every init.d script every start-stop-daemon
> call should be wrapped in such way, or am I missing something?

No, you're probably not missing anything.  But when you are executing
something that may fail, it's always good practice to catch the error
and handle it, rather than letting it abort your program.

> > You also probably don't need to recursively remove a single file, and I
> > imagine it's vaguely safer in the event that $PIDFILE expands wrongly.
> That is very true! I will take care about that - thank you!

Thanks for that.

Take care,
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

Reply via email to