cluster/rgmanager/src/resources apache.sh
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: fabbione at sourceware.org 2008-01-14 05:26:21
Modified files:
rgmanager/src/resources: apache.sh
Log message:
Allow the resource to run on Debian/Ubuntu systems without manual patching, by checking for the apache2 daemon if httpd is not available.
Replace =~ '^/' sintax with less bash dependent version.
Use grep -E instead of -P as perl regexp support is not built on all distros.
rgmanager/src/resources/apache.sh +7 -3
@@ -32,7 +32,11 @@ . $(dirname $0)/utils/messages.sh . $(dirname $0)/utils/ra-skelet.sh -declare APACHE_HTTPD=/usr/sbin/httpd +if [ -x /usr/sbin/httpd ]; then + declare APACHE_HTTPD=/usr/sbin/httpd +elif [ -x /usr/sbin/apache2 ]; then + declare APACHE_HTTPD=/usr/sbin/apache2 +fi declare APACHE_serverConfigFile declare APACHE_pid_file="`generate_name_for_pid_file`" declare APACHE_conf_dir="`generate_name_for_conf_dir`"
@@ -42,7 +46,7 @@ apache_serverConfigFile() { - if [[ "$OCF_RESKEY_config_file" =~ '^/' ]]; then + if $(echo $OCF_RESKEY_config_file | grep -q "^/"); then APACHE_serverConfigFile="$OCF_RESKEY_config_file" else APACHE_serverConfigFile="$OCF_RESKEY_server_root/$OCF_RESKEY_config_file"
@@ -135,7 +139,7 @@ IFS_old="$IFS" IFS=$'\n' - for i in `"$APACHE_parseConfig" -D"$OCF_RESKEY_name" < "$originalConfigFile" | grep -P '(^Listen)|(^Port)' | grep -v ':'`; do + for i in `"$APACHE_parseConfig" -D"$OCF_RESKEY_name" < "$originalConfigFile" | grep -E '(^Listen)|(^Port)' | grep -v ':'`; do port=`echo $i | sed 's/^Listen \(.*\)/\1/;s/^Port \(.*\)/\1/'`; IFS=$' '; for z in $ip_addresses; do