Package: wwwconfig-common
Version: 0.0.47
Severity: important
Tags: patch

If the command "/etc/init.d/$A restart" called from restart.sh fails
(for example, if the web server can not be started because port 80 is
already used by another program), the script will stop and fail, making
the postinst script of the calling package fail as well.

I believe that restart.sh should catch the error and return it in the
"error" environment variable, so postinst (or another calling script) can
handle it in the way it sees fit.

See (RC) bug #398638 for an example (package w3c-markup-validator).

The following patch fixes it for me; there may be other ways to do it.
It works with a modified version of w3c-markup-validator (where postinst
has been modified to notice the error), but I obviously can't upload the
modified package for now.

--- restart.sh  2006-10-11 21:31:57.000000000 +0200
+++ restart.sh.new      2006-11-17 20:14:35.000000000 +0100
@@ -33,7 +33,10 @@
        if [ "$verify" != "$restart" ] ; then
            log="${log}$A needs to be restarted."
                if [ -x /etc/init.d/$A ] ; then
-               /etc/init.d/$A restart >/dev/null 2>&1 3>&1 4>&1 5>&1
+               if ! /etc/init.d/$A restart >/dev/null 2>&1 3>&1 4>&1 5>&1; then
+                  status="error"
+                  error="ERROR! /etc/init.d/$A returned an error, $A could not 
be restarted."
+               fi
            else
                status="error"
                error="ERROR! But /etc/init.d/$A is not installed (or not 
executable)."


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-2-686-bigmem
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

-- no debconf information


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

Reply via email to