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

Bug#691365: apache2: invoke-rc.d apache2 status fails



Package: apache2
Version: 2.4.3-1
Severity: normal
Tags: patch

After a complex and wrong upgrade to latest debian git snapshot of apache2, I
ended up with old 2.2 apache2-mpm-worker in broken state. I purge it and had to
kill -9 the processes.
http://paste.debian.net/203339/

Anyways, after that operation I found myself with /etc/init.d/apache2 status
not working.

I traced the problem to a call of
status_of_proc apache2 apache2 -p /var/run/apache2/apache2.pid
that calls
pidofproc apache2
that find an obsolete file /var/run/apache2.pid (instead of
/var/run/apache2/apache2.pid).

The thing is
status_of_proc -p /var/run/apache2/apache2.pid apache2 apache2
yields
[ ok ] apache2 is running, while
status_of_proc apache2 apache2 -p /var/run/apache2/apache2.pid
yields
[FAIL] apache2 is not running ... failed!

So the -p parameter position need to be inverted in init.d/apache2

The problem will only show if you have a stale pid file in obsolete file
/var/run/apache2.pid

Patch attached.

-- Package-specific info:
Enabled MPM: worker
List of enabled modules:
  env (enabled by unknown)
   autoindex (enabled by unknown)
   status (enabled by unknown)
   authn_file (enabled by unknown)
   authz_groupfile (enabled by unknown)
   authz_host (enabled by unknown)
   filter (enabled by maintainer script)
   auth_basic (enabled by unknown)
   mpm_worker (enabled by site administrator)
   cgid (enabled by unknown)
   access_compat (enabled by maintainer script)
   deflate (enabled by unknown)
   reqtimeout (enabled by unknown)
   authz_user (enabled by unknown)
   setenvif (enabled by unknown)
   authz_core (enabled by maintainer script)
   dir (enabled by unknown)
   negotiation (enabled by unknown)
   mime (enabled by unknown)
   alias (enabled by unknown)
List of enabled configurations:
  security.conf (enabled by unknown)
   localized-error-pages.conf (enabled by unknown)
   other-vhosts-access-log.conf (enabled by unknown)
   charset.conf (enabled by unknown)
   serve-cgi-bin.conf (enabled by maintainer script)

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apache2 depends on:
ii  apache2-bin   2.4.3-1
ii  apache2-data  2.4.3-1
ii  lsb-base      4.1+Debian7
ii  mime-support  3.52-1
ii  perl          5.14.2-14
ii  procps        1:3.3.3-2

Versions of packages apache2 recommends:
ii  ssl-cert  1.0.32

Versions of packages apache2 suggests:
ii  apache2-doc                                      2.4.1-1
pn  apache2-suexec-pristine | apache2-suexec-custom  <none>
pn  apache2-utils                                    <none>
ii  chromium [www-browser]                           21.0.1180.89~r154005-1
ii  iceweasel [www-browser]                          10.0.9esr-1
ii  lynx-cur [www-browser]                           2.8.8dev.12-2
ii  w3m [www-browser]                                0.5.3-8

Versions of packages apache2-bin depends on:
ii  libapr1                  1.4.6-3
ii  libaprutil1              1.4.1-3
ii  libaprutil1-dbd-sqlite3  1.4.1-3
ii  libaprutil1-ldap         1.4.1-3
ii  libc6                    2.13-35
ii  libldap-2.4-2            2.4.31-1
ii  liblua5.1-0              5.1.5-4
ii  libpcre3                 1:8.30-5
ii  libssl1.0.0              1.0.1c-4
ii  libxml2                  2.8.0+dfsg1-6
ii  perl                     5.14.2-14
ii  zlib1g                   1:1.2.7.dfsg-13

Versions of packages apache2-bin suggests:
ii  apache2-doc                                      2.4.1-1
pn  apache2-suexec-pristine | apache2-suexec-custom  <none>
ii  chromium [www-browser]                           21.0.1180.89~r154005-1
ii  iceweasel [www-browser]                          10.0.9esr-1
ii  lynx-cur [www-browser]                           2.8.8dev.12-2
ii  w3m [www-browser]                                0.5.3-8

Versions of packages apache2 is related to:
ii  apache2      2.4.3-1
ii  apache2-bin  2.4.3-1

-- Configuration Files:
/etc/init.d/apache2 changed [not included]

-- no debconf information
--- debian/apache2.init	2012-10-24 18:06:26.000000000 +0200
+++ /etc/init.d/apache2	2012-10-24 21:24:49.000000000 +0200
@@ -79,7 +79,7 @@
 apache_wait_stop() {
         local STATUS=$1
 
-        PIDTMP=$(pidofproc $DAEMON -p $PIDFILE)
+        PIDTMP=$(pidofproc -p $PIDFILE $DAEMON)
         if [ -n "${PIDTMP:-}" ] && kill -0 "${PIDTMP:-}" 2> /dev/null; then
                 local i=0
                 while kill -0 "${PIDTMP:-}" 2> /dev/null;  do
@@ -108,7 +108,7 @@
 	#   1 if daemon was already running
 	#   2 if daemon could not be started
 
-	if pidofproc "$DAEMON" -p $PIDFILE > /dev/null 2>&1 ; then
+	if pidofproc -p $PIDFILE "$DAEMON" > /dev/null 2>&1 ; then
                 return 1
         fi
 
@@ -180,7 +180,7 @@
 #
 do_reload() {
         if $APACHE2CTL configtest > /dev/null 2>&1; then
-	        if ! pidofproc "$DAEMON" -p $PIDFILE > /dev/null 2>&1 ; then
+	        if ! pidofproc -p $PIDFILE "$DAEMON" > /dev/null 2>&1 ; then
                         APACHE2_INIT_MESSAGE="Apache2 is not running"
                         return 2
                 fi
@@ -279,7 +279,7 @@
 
 	;;
   status)
-	status_of_proc "apache2" "$NAME" -p $PIDFILE && exit 0 || exit $?
+	status_of_proc -p $PIDFILE "apache2" "$NAME" && exit 0 || exit $?
 	;;
   reload|force-reload|graceful)
 	log_daemon_msg "Reloading $DESC" "$NAME"

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: