resource-agents/rhbz915959-apache-resource-pidfile-path.patch
2013-03-11 16:14:53 -05:00

40 lines
1.4 KiB
Diff

diff --git a/heartbeat/apache b/heartbeat/apache
index d702765..a313372 100755
--- a/heartbeat/apache
+++ b/heartbeat/apache
@@ -173,7 +173,12 @@ apache_start() {
validate_default_config || return $OCF_ERR_CONFIGURED
# https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/603211
[ -d /var/run/apache2 ] || mkdir /var/run/apache2
- ocf_run $HTTPD $HTTPDOPTS $OPTIONS -f $CONFIGFILE
+ if [ -z $PIDFILE_DIRECTIVE ];
+ then
+ ocf_run $HTTPD $HTTPDOPTS $OPTIONS -f $CONFIGFILE
+ else
+ ocf_run $HTTPD $HTTPDOPTS $OPTIONS -f $CONFIGFILE -c "PidFile $PidFile"
+ fi
tries=0
while : # wait until the user set timeout
do
diff --git a/heartbeat/apache-conf.sh b/heartbeat/apache-conf.sh
index 12723cb..cf679cc 100644
--- a/heartbeat/apache-conf.sh
+++ b/heartbeat/apache-conf.sh
@@ -139,7 +139,15 @@ GetParams() {
case $PidFile in
/*) ;;
[[:alnum:]]*) PidFile=$ServerRoot/$PidFile;;
- *) PidFile=$HA_VARRUNDIR/${httpd_basename}.pid;;
+ *)
+ # If the PidFile is not set in the config, set
+ # a default location.
+ PidFile=$HA_VARRUNDIR/${httpd_basename}.pid
+ # Force the daemon to use this location by using
+ # the -c option, which adds the PidFile directive
+ # as if it was in the configuration file to begin with.
+ PIDFILE_DIRECTIVE="true"
+ ;;
esac
for p in "$PORT" "$Port" 80; do