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

Bug#339323: apache2-common: /etc/init.d/apache2 throws away error information [patch]



Package: apache2-common
Version: 2.0.55-3

/etc/init.d/apache2 runs "apachectl -t" to catch any errors (good!),
however it then assumes it's confused and checks pids etc.

This patch makes it print the output of apachectl -t (which in my case
told me I had the path wrong of an SSL certificate).

It also skips the pids warning unless it finds a culprit.

Thanks,

Adrian
-- 
Email: adrian@smop.co.uk  -*-  GPG key available on public key servers
Debian GNU/Linux - the maintainable distribution   -*-  www.debian.org
Avoid working with children, animals and Microsoft "operating" systems
--- apache2.orig	2005-10-23 05:41:08.000000000 +0100
+++ apache2	2005-11-15 14:07:49.000000000 +0000
@@ -43,7 +43,8 @@
 		fi
 	done
 	
-	if `$APACHE2 -t > /dev/null 2>&1`; then
+	errors=`$APACHE2 -t 2>&1`
+	if [ $? = 0 ]; then
 		# if the config is ok than we just stop normaly
 
 		if [ -n "$PID" ]
@@ -75,6 +76,9 @@
 		fi
 
 	else
+		echo
+	        echo  $errors
+
 		# if we are here something is broken and we need to try
 		# to exit as nice and clean as possible
 
@@ -104,7 +108,7 @@
 			#	kill $i
 			#done
 			# Except, we can't do that, because it's very, very bad
-			if [ "$VERBOSE" != "no" ]; then
+			if [ "$PIDS" ] && [ "$VERBOSE" != "no" ]; then
                                 echo " ... failed!"
 			        echo "You may still have some apache2 processes running.  There are"
  			        echo "processes named 'apache2' which do not match your pid file,"

Reply to: