[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-ha-dev
Subject: [Linux-ha-dev] [PATCH]A monitor error and the log output of slapd
From: nozawat <nozawat () gmail ! com>
Date: 2011-12-28 8:52:51
Message-ID: CAACmvNFyoUoaijh5f6faUf7G7W6m8wVRXqmtWn4FXNFf8qSL-A () mail ! gmail ! com
[Download RAW message or body]
Hi
The patches of slapd are as follows.
1)slapd-001.patch
->I made modifications to output a value of result code.
2)slapd-002.patch
->An error occurs at the time of a start by a timing.
Therefore I made modifications to restrain the error at the time
of the start.
Regards,
Tomo
["slapd-001.patch" (application/octet-stream)]
diff --git a/heartbeat/slapd b/heartbeat/slapd
index c5e0854..be71369 100755
--- a/heartbeat/slapd
+++ b/heartbeat/slapd
@@ -445,7 +445,7 @@ slapd_monitor()
return $OCF_ERR_CONFIGURED
;;
*)
- ocf_log err "slapd database with suffix '$suffix' unreachable."
+ ocf_log err "slapd database with suffix '$suffix' unreachable. result code ($result)"
state=$OCF_ERR_GENERIC
;;
esac
["slapd-002.patch" (application/octet-stream)]
diff --git a/heartbeat/slapd b/heartbeat/slapd
index be71369..5ce4063 100755
--- a/heartbeat/slapd
+++ b/heartbeat/slapd
@@ -434,8 +434,11 @@ slapd_monitor()
fi
for suffix in $suffixes; do
- ocf_run -q "$ldapsearch" -H "$services" -b "$suffix" $options >/dev/null 2>&1; result=$?
-
+ if [ -z $1 ];then
+ ocf_run -q "$ldapsearch" -H "$services" -b "$suffix" $options >/dev/null 2>&1; result=$?
+ else
+ ocf_run -q -err "$ldapsearch" -H "$services" -b "$suffix" $options >/dev/null 2>&1; result=$?
+ fi
case "$result" in
"0")
ocf_log debug "slapd database with suffix '$suffix' reachable"
@@ -445,8 +448,15 @@ slapd_monitor()
return $OCF_ERR_CONFIGURED
;;
*)
- ocf_log err "slapd database with suffix '$suffix' unreachable. result code ($result)"
- state=$OCF_ERR_GENERIC
+ if [ -z $1 ];then
+ ocf_log err "slapd database with suffix '$suffix' unreachable. result code ($result)"
+ state=$OCF_ERR_GENERIC
+ else
+ if [ $result -ne 1 ];then
+ ocf_log err "slapd database with suffix '$suffix' unreachable. result code ($result)"
+ state=$OCF_ERR_GENERIC
+ fi
+ fi
;;
esac
done
_______________________________________________________
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/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic