Hi Raoul,
Hi All,

I send the modified patch of the resource agent of postfix.

The correction is two points.

 * Change of the log level in conjunction with the monitor processing.
 * Deletion of an unnecessary loop by the stop processing

Please please confirm my correction.
And please commit a correction.

Best Regards,
Hideo Yamauchi.
diff -r 52dcb4318e21 heartbeat/postfix
--- a/heartbeat/postfix Mon Nov 14 14:46:36 2011 +0900
+++ b/heartbeat/postfix Mon Nov 14 14:47:03 2011 +0900
@@ -96,12 +96,15 @@
 }
 
 postfix_running() {
+    local loglevel 
+    loglevel=${1:-err} 
+
     # run Postfix status if available
     if ocf_is_true $status_support; then
         output=`$binary $OPTION_CONFIG_DIR status 2>&1`
         ret=$?
         if [ $ret -ne 0 ]; then
-            ocf_log err "Postfix status: '$output'." $ret
+            ocf_log $loglevel "Postfix status: '$output'." $ret
         fi
         return $ret
     fi
@@ -121,7 +124,7 @@
 postfix_start()
 {
     # if Postfix is running return success
-    if postfix_running; then
+    if postfix_running info; then
         ocf_log info "Postfix already running."
         return $OCF_SUCCESS
     fi
@@ -140,7 +143,7 @@
     while true; do
         sleep 1
         # break if postfix is up and running; log failure otherwise
-        postfix_running && break
+        postfix_running info && break
         ocf_log info "Postfix failed initial monitor action." $ret
     done
 
@@ -152,7 +155,7 @@
 postfix_stop()
 {
     # if Postfix is not running return success
-    if ! postfix_running; then
+    if ! postfix_running info; then
         ocf_log info "Postfix already stopped."
         return $OCF_SUCCESS
     fi
@@ -168,14 +171,17 @@
 
     # grant some time for shutdown and recheck 5 times
     for i in 1 2 3 4 5; do
-        if postfix_running; then
+        if postfix_running info; then
             sleep 1
+        else
+            ocf_log info "Postfix stopped."  
+#            return $OCF_SUCCESS
         fi
     done
 
     # escalate to abort if we did not stop by now
     # @TODO shall we loop here too?
-    if postfix_running; then
+    if postfix_running info; then
         ocf_log err "Postfix failed to stop. Escalating to 'abort'."
 
         $binary $OPTIONS abort >/dev/null 2>&1; ret=$?
@@ -202,7 +208,14 @@
 
 postfix_monitor()
 {
-    if postfix_running; then
+    local status_loglevel="err"
+
+    # Set loglevel to info during probe 
+    if ocf_is_probe; then 
+        status_loglevel="info" 
+    fi 
+
+    if postfix_running $status_loglevel; then
         return $OCF_SUCCESS
     fi
 
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to