[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#613969: /etc/init.d/apache2 status fails to comply with LSB spec



Package: apache2.2-common
Version: 2.2.16-6
Severity: normal
Tags: patch

As shipped the init script for Apache2 fails to return LSB compliant error codes when the status is queried. This is important when using LSB scripts with clustering solutions such as Pacemaker[1] that require init scripts to return correct error codes. 

The following patch fixes the apache2 init script to return the correct codes when quering status according to the LSB spec[2]. Please consider including the patch in a future point release update. 

Thanks!

Patch:
--- apache2.2-common.apache2.init	2011-02-18 14:49:37.000000000 +0000
+++ /etc/init.d/apache2	2011-02-18 14:48:04.000000000 +0000
@@ -266,7 +266,11 @@
 			exit 0
 		else
 			echo "Apache2$DIR_SUFFIX is NOT running."
-			exit 1
+			if [ -e "$PIDFILE" ]; then
+				exit 1
+			else
+				exit 3
+			fi
 		fi
 	;;
 	*)

[1] http://www.linux-ha.org/wiki/LSB_Resource_Agents
[2] http://refspecs.freestandards.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

-- Package-specific info:
List of enabled modules from 'apache2 -M':
  alias auth_basic authn_file authz_default authz_groupfile
  authz_host authz_user autoindex cgid deflate dir env mime
  negotiation reqtimeout setenvif status

-- System Information:
Debian Release: 6.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apache2 depends on:
ii  apache2-mpm-worker            2.2.16-6   Apache HTTP Server - high speed th
ii  apache2.2-common              2.2.16-6   Apache HTTP Server common files

apache2 recommends no packages.

apache2 suggests no packages.

Versions of packages apache2.2-common depends on:
ii  apache2-utils           2.2.16-6         utility programs for webservers
ii  apache2.2-bin           2.2.16-6         Apache HTTP Server common binary f
ii  libmagic1               5.04-5           File type determination library us
ii  lsb-base                3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii  mime-support            3.48-1           MIME files 'mime.types' & 'mailcap
ii  perl                    5.10.1-17        Larry Wall's Practical Extraction 
ii  procps                  1:3.2.8-9        /proc file system utilities

-- no debconf information



Reply to: