Skip to content
Browse files

Merge pull request #214 from davidvossel/apache_pidfile_path

Low: apache: Add pidfile directive when not present in config file
  • Loading branch information...
2 parents 75afe09 + 2ce0b97 commit 923f4cf8bfa7a89fae76877fc67c973a22196946 @dmuhamedagic dmuhamedagic committed Mar 28, 2013
Showing with 15 additions and 2 deletions.
  1. +6 −1 heartbeat/apache
  2. +9 −1 heartbeat/apache-conf.sh
View
7 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
View
10 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

0 comments on commit 923f4cf

Please sign in to comment.
Something went wrong with that request. Please try again.