* [Cluster-devel] cluster/rgmanager/src/resources apache.sh
@ 2006-09-20 8:50 mgrac
0 siblings, 0 replies; 2+ messages in thread
From: mgrac @ 2006-09-20 8:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: mgrac at sourceware.org 2006-09-20 08:50:12
Modified files:
rgmanager/src/resources: apache.sh
Log message:
After upgrade to 'unified names for PID files' we can clean code a bit.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/apache.sh.diff?cvsroot=cluster&r1=1.4&r2=1.5
--- cluster/rgmanager/src/resources/apache.sh 2006/09/20 08:07:04 1.4
+++ cluster/rgmanager/src/resources/apache.sh 2006/09/20 08:50:12 1.5
@@ -39,35 +39,6 @@
declare APACHE_parseConfig=$(dirname $0)/utils/httpd-parse-config.pl
-apache_pidFile()
-{
- declare tmpFile="/tmp/httpd.$OCF_RESKEY_name.$$"
- declare CFG_serverRoot
-
- if [ -f "$APACHE_genConfig" ]; then
- sha1_verify "$APACHE_genConfig"
- if [ $? -ne 0 ]; then
- ocf_log debug "Config file changed; skipping"
- cp "$APACHE_genConfig" "$tmpFile"
- else
- generate_configFile "$APACHE_serverConfigFile" "$tmpFile"
- fi
- else
- generate_configFile "$APACHE_serverConfigFile" "$tmpFile"
- fi
-
- CFG_serverRoot=`grep -e '^ServerRoot' "$tmpFile" | head -n 1 | \
- sed 's/^ServerRoot "\(.*\)"/\1/;s/^ServerRoot \(.*\)/\1/'`
-
- if [ -z "$CFG_serverRoot" ]; then
- CFG_serverRoot="$OCF_RESKEY_server_root"
- fi
-
- rm -f "$tmpFile"
-
- return;
-}
-
apache_serverConfigFile()
{
if [[ "$OCF_RESKEY_config_file" =~ '^/' ]]; then
@@ -256,7 +227,6 @@
if [ "$1" != "meta-data" ]; then
apache_serverConfigFile
- apache_pidFile
fi;
case $1 in
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cluster-devel] cluster/rgmanager/src/resources apache.sh
@ 2008-01-14 5:26 fabbione
0 siblings, 0 replies; 2+ messages in thread
From: fabbione @ 2008-01-14 5:26 UTC (permalink / raw)
To: cluster-devel.redhat.com
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.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/apache.sh.diff?cvsroot=cluster&r1=1.10&r2=1.11
--- cluster/rgmanager/src/resources/apache.sh 2007/04/05 15:08:19 1.10
+++ cluster/rgmanager/src/resources/apache.sh 2008/01/14 05:26:21 1.11
@@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-14 5:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-20 8:50 [Cluster-devel] cluster/rgmanager/src/resources apache.sh mgrac
-- strict thread matches above, loose matches on Subject: below --
2008-01-14 5:26 fabbione
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).