Blame SOURCES/bz1183136-nginx-support.patch

261ad6
From d828c825c58f2da4b4edd6548c5fd254842a0add Mon Sep 17 00:00:00 2001
261ad6
From: David Vossel <dvossel@redhat.com>
261ad6
Date: Wed, 29 Apr 2015 11:15:18 -0500
261ad6
Subject: [PATCH 4/6] nginx agent support
261ad6
261ad6
---
261ad6
 heartbeat/nginx | 27 ++++++++++++---------------
261ad6
 1 file changed, 12 insertions(+), 15 deletions(-)
261ad6
261ad6
diff --git a/heartbeat/nginx b/heartbeat/nginx
261ad6
index 65fd8f2..fadc545 100755
261ad6
--- a/heartbeat/nginx
261ad6
+++ b/heartbeat/nginx
261ad6
@@ -31,7 +31,7 @@
261ad6
 #  OCF_RESKEY_status10regex
261ad6
 #  OCF_RESKEY_status10url
261ad6
 #  OCF_RESKEY_client
261ad6
-#  OCF_RESKEY_testurl
261ad6
+#  OCF_RESKEY_test20url
261ad6
 #  OCF_RESKEY_test20regex
261ad6
 #  OCF_RESKEY_test20conffile
261ad6
 #  OCF_RESKEY_test20name
261ad6
@@ -416,7 +416,7 @@ start_nginx() {
261ad6
     return $OCF_SUCCESS
261ad6
   fi
261ad6
   if 
261ad6
-    ocf_run $NGINXD -t -c $CONFIGFILE
261ad6
+    ocf_run $NGINXD $OPTIONS -t -c $CONFIGFILE
261ad6
   then
261ad6
     : Configuration file $CONFIGFILE looks OK
261ad6
   else
261ad6
@@ -442,7 +442,7 @@ start_nginx() {
261ad6
       [ $ec -eq $OCF_NOT_RUNNING ]
261ad6
     then
261ad6
       tries=`expr $tries + 1`
261ad6
-      ocf_log info "Waiting for $NGINXD -c $CONFIGFILE to come up (try $tries)"
261ad6
+      ocf_log info "Waiting for $NGINXD $OPTIONS -c $CONFIGFILE to come up (try $tries)"
261ad6
       true
261ad6
     else
261ad6
       false
261ad6
@@ -727,25 +727,25 @@ For example, you can set this paramter to "wget" if you prefer that to curl.
261ad6
 <content type="string" />
261ad6
 </parameter>
261ad6
 
261ad6
-<parameter name="testurl">
261ad6
+<parameter name="test20url">
261ad6
 <longdesc lang="en">
261ad6
 URL to test. If it does not start with "http", then it's
261ad6
 considered to be relative to the document root address.
261ad6
 </longdesc>
261ad6
-<shortdesc lang="en">Level 10 monitor url</shortdesc>
261ad6
+<shortdesc lang="en">Level 20 monitor url</shortdesc>
261ad6
 <content type="string" />
261ad6
 </parameter>
261ad6
 
261ad6
 <parameter name="test20regex">
261ad6
 <longdesc lang="en">
261ad6
-Regular expression to match in the output of testurl.
261ad6
+Regular expression to match in the output of test20url.
261ad6
 Case insensitive.
261ad6
 </longdesc>
261ad6
 <shortdesc lang="en">Level 20 monitor regular expression</shortdesc>
261ad6
 <content type="string" />
261ad6
 </parameter>
261ad6
 
261ad6
-<parameter name="testconffile">
261ad6
+<parameter name="test20conffile">
261ad6
 <longdesc lang="en">
261ad6
 A file which contains a more complex test configuration. Could be useful if
261ad6
 you have to check more than one web application or in case sensitive
261ad6
@@ -785,14 +785,11 @@ Extra options to apply when starting nginx.
261ad6
 </parameters>
261ad6
 
261ad6
 <actions>
261ad6
-<action name="start"   timeout="40s" />
261ad6
+<action name="start"   timeout="60s" />
261ad6
 <action name="stop"    timeout="60s" />
261ad6
 <action name="reload"  timeout="40s" />
261ad6
 <action name="status"  timeout="30s" />
261ad6
-<action name="monitor" timeout="30s" depth="0" interval="10s" />
261ad6
-<action name="monitor" timeout="30s" depth="10" interval="30s" />
261ad6
-<action name="monitor" timeout="45s" depth="20" />
261ad6
-<action name="monitor" timeout="60s" depth="30" />
261ad6
+<action name="monitor" timeout="30s" depth="0" interval="20s" />
261ad6
 <action name="meta-data"  timeout="5" />
261ad6
 <action name="validate-all"  timeout="5" />
261ad6
 </actions>
261ad6
@@ -838,11 +835,11 @@ validate_all_nginx() {
261ad6
     exit $OCF_ERR_CONFIGURED
261ad6
   fi
261ad6
   if
261ad6
-    ocf_run $NGINXD -t -c $CONFIGFILE
261ad6
+    ocf_run $NGINXD $OPTIONS -t -c $CONFIGFILE
261ad6
   then
261ad6
     : Cool $NGINXD likes $CONFIGFILE
261ad6
   else
261ad6
-    ocf_log err "$NGINXD -t -c $CONFIGFILE reported a configuration error."
261ad6
+    ocf_log err "$NGINXD $OPTIONS -t -c $CONFIGFILE reported a configuration error."
261ad6
     return $OCF_ERR_CONFIGURED
261ad6
   fi
261ad6
   return $OCF_SUCCESS
261ad6
@@ -859,7 +856,7 @@ then
261ad6
   OPTIONS="$OCF_RESKEY_options"
261ad6
   CLIENT=${OCF_RESKEY_client}
261ad6
   TESTREGEX=${OCF_RESKEY_status10regex:-'Reading: [0-9]+ Writing: [0-9]+ Waiting: [0-9]+'}
261ad6
-  TESTURL="$OCF_RESKEY_status10url"
261ad6
+  TESTURL="$OCF_RESKEY_test20url"
261ad6
   TESTREGEX20=${OCF_RESKEY_test20regex}
261ad6
   TESTCONFFILE="$OCF_RESKEY_test20conffile"
261ad6
   TESTNAME="$OCF_RESKEY_test20name"
261ad6
-- 
261ad6
1.8.4.2
261ad6