Steve Langasek wrote:

Your postinst runs under set -e, as it should, and then it sources
/usr/share/wwwconfig-common/restart.sh (it does *not* execute it).   That
means any non-zero exit codes from restart.sh are going to propagate and
result in the shell (i.e., the postinst) exiting non-zero.

You may be able to address this by checking the return value of the source
command, e.g.:

if ! . /usr/share/wwwconfig-common/restart.sh ; then
        handle_the_error
fi

Almost there...

This does not work, as far as I can tell, because the sourced file also runs under "set -e"; so if it exits at some point, postinst is doomed and can not do any error handling. And restart.sh actually execute /etc/init.d/apache2, which fails, and so postinst fails too.

The problem is probably in restart.sh, which should wrap the call with the "if ! ... fi", and then if it fails, return an error to postinst (through an environment variable).

I could 1) submit a new bug against wwwconfig-common, and then 2) modify my postinst so that it checks for a reported error from restart.sh and handles it.

Is there any better solution ?

Thanks for the help,

Frédéric




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to