Blame SOURCES/bz10005924-default-apache-config.patch

cf07b3
diff --git a/heartbeat/apache b/heartbeat/apache
cf07b3
index 726e8fb..1369804 100755
cf07b3
--- a/heartbeat/apache
cf07b3
+++ b/heartbeat/apache
cf07b3
@@ -63,7 +63,8 @@ fi
cf07b3
 LOCALHOST="http://localhost"
cf07b3
 HTTPDOPTS="-DSTATUS"
cf07b3
 DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf
cf07b3
-DEFAULT_NORMCONFIG="/etc/apache2/httpd.conf"
cf07b3
+DEFAULT_SUSECONFIG="/etc/apache2/httpd.conf"
cf07b3
+DEFAULT_RHELCONFIG="/etc/httpd/conf/httpd.conf"
cf07b3
 #
cf07b3
 # You can also set
cf07b3
 #	HTTPD
cf07b3
@@ -82,7 +83,8 @@ CMD=`basename $0`
cf07b3
 #	assumed if no config file is specified. If this command is
cf07b3
 #	invoked as *IBM*, then the default config file name is
cf07b3
 #	$DEFAULT_IBMCONFIG, otherwise the default config file
cf07b3
-#	will be $DEFAULT_NORMCONFIG.
cf07b3
+#	will be either $DEFAULT_RHELCONFIG or $DEFAULT_SUSECONFIG depending
cf07b3
+#	on which is detected.
cf07b3
 usage() {
cf07b3
 cat <<-!
cf07b3
 usage: $0 action
cf07b3
@@ -146,7 +148,7 @@ validate_default_config() {
cf07b3
 # the relevant config is generated and valid.  We're also taking
cf07b3
 # this opportunity to enable mod_status if it's not present.
cf07b3
 validate_default_suse_config() {
cf07b3
-	if [ "$CONFIGFILE" = "$DEFAULT_NORMCONFIG" ] && \
cf07b3
+	if [ "$CONFIGFILE" = "$DEFAULT_SUSECONFIG" ] && \
cf07b3
 		grep -Eq '^Include[[:space:]]+/etc/apache2/sysconfig.d/include.conf' "$CONFIGFILE"
cf07b3
 	then
cf07b3
 		[ -x "/usr/sbin/a2enmod" ] && ocf_run -q /usr/sbin/a2enmod status
cf07b3
@@ -336,6 +338,16 @@ apache_monitor() {
cf07b3
 	esac
cf07b3
 }
cf07b3
 
cf07b3
+detect_default_config()
cf07b3
+{
cf07b3
+	if [ -f $DEFAULT_SUSECONFIG ]; then
cf07b3
+		echo $DEFAULT_SUSECONFIG
cf07b3
+	else
cf07b3
+		echo $DEFAULT_RHELCONFIG
cf07b3
+	fi
cf07b3
+}
cf07b3
+
cf07b3
+
cf07b3
 apache_meta_data(){
cf07b3
 	cat <
cf07b3
 
cf07b3
@@ -373,7 +385,7 @@ This file is parsed to provide defaults for various other
cf07b3
 resource agent parameters.
cf07b3
 </longdesc>
cf07b3
 <shortdesc lang="en">configuration file path</shortdesc>
cf07b3
-<content type="string" default="/etc/apache2/httpd.conf" />
cf07b3
+<content type="string" default="$(detect_default_config)" />
cf07b3
 </parameter>
cf07b3
 
cf07b3
 <parameter name="httpd">
cf07b3
@@ -548,7 +560,7 @@ find_httpd_prog() {
cf07b3
 			if [ "X$OCF_RESKEY_httpd" != X -a "X$HTTPD" != X ]; then
cf07b3
 				ocf_log info "Using $HTTPD as HTTPD"
cf07b3
 			fi
cf07b3
-			DefaultConfig=$DEFAULT_NORMCONFIG
cf07b3
+			DefaultConfig=$(detect_default_config)
cf07b3
 			;;
cf07b3
 	esac
cf07b3
 }
cf07b3