Cristian Mammoli - Apra Sistemi wrote:

So do I assume correctly that current upstream is working OK for you?

I'll do more tests this afternoon but I definitely think it's working.


It works, attached is the diff between my .ocf-shellfuncs and upstream .ocf-shellfuns.in

--
Cristian Mammoli
APRA SISTEMI srl
Via Brodolini,6 Jesi (AN)
tel dir. 0731 719822

Web   www.apra.it
e-mail  [email protected]
--- .ocf-shellfuncs	2010-03-09 12:34:22.000000000 +0100
+++ .ocf-shellfuncs.in	2010-03-09 14:40:12.000000000 +0100
@@ -22,7 +22,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 # 
 
-# Build version: 61203c6ef710e35660f0d76047561877963d3a2f
+# Build version: @BUILD_VERSION@
 
 # TODO: Some of this should probably split out into a generic OCF
 # library for shell scripts, but for the time being, we'll just use it
@@ -44,7 +44,7 @@
 __SCRIPT_NAME=`basename $0`
 
 if [ -z "$OCF_ROOT" ]; then
-    : ${OCF_ROOT=/usr/lib/ocf}
+    : ${ocf_ro...@ocf_root_dir@}
 fi
 
 : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat}
@@ -166,6 +166,18 @@
 }
 
 ha_log() {
+	# if we're connected to a tty, then output to stderr
+	if tty >/dev/null; then
+		if [ "x$HA_debug" = "x0" -a "x$loglevel" = xdebug ] ; then
+			return 0
+		fi
+		if [ "$HA_LOGTAG" ]; then
+			echo "$HA_LOGTAG: $*"
+		else
+			echo "$*"
+		fi >&2
+		return 0
+	fi
 	if [ "x${HA_LOGD}" = "xyes" ] ; then 
 		ha_logger -t "${HA_LOGTAG}" "$@"
 		if [ "$?" -eq "0" ] ; then
@@ -191,7 +203,11 @@
 	then
 	  : appending to $HA_LOGFILE
 	  echo "$HA_LOGTAG:	"`hadate`"${*}" >> $HA_LOGFILE
-	else
+	fi
+	if
+	  [ -z "$HA_LOGFACILITY" -a -z "$HA_LOGFILE" ]
+	then
+	  : appending to stderr
 	  echo `hadate`"${*}" >&2
 	fi
         if
@@ -207,6 +223,14 @@
         if [ "x${HA_debug}" = "x0" ] ; then
                 return 0
         fi
+	if tty >/dev/null; then
+		if [ "$HA_LOGTAG" ]; then
+			echo "$HA_LOGTAG: $*"
+		else
+			echo "$*"
+		fi >&2
+		return 0
+	fi
 
         if [ "x${HA_LOGD}" = "xyes" ] ; then  
 		ha_logger -t "${HA_LOGTAG}" -D "ha-debug" "$@"
@@ -226,7 +250,11 @@
 	then
 	  : appending to $HA_DEBUGLOG
 	  echo "$HA_LOGTAG:	"`hadate`"${*}" >> $HA_DEBUGLOG
-	else
+	fi
+	if
+	  [ -z "$HA_LOGFACILITY" -a -z "$HA_DEBUGLOG" ]
+	then
+	  : appending to stderr
 	  echo "$HA_LOGTAG:	`hadate`${*}:	${HA_LOGFACILITY}" >&2
 	fi
 }
@@ -359,6 +387,20 @@
     [ "$__OCF_ACTION" = "monitor" -a "$OCF_RESKEY_CRM_meta_interval" = 0 ]
 }
 
+# returns true if the resource is configured as a clone. This is
+# defined as a resource where the clone-max meta attribute is present,
+# and set to greater than zero.
+ocf_is_clone() {
+    [ ! -z "${OCF_RESKEY_CRM_meta_clone_max}" ] && [ "${OCF_RESKEY_CRM_meta_clone_max}" -gt 0 ]
+}
+
+# returns true if the resource is configured as a multistate
+# (master/slave) resource. This is defined as a resource where the
+# master-max meta attribute is present, and set to greater than zero.
+ocf_is_ms() {
+    [ ! -z "${OCF_RESKEY_CRM_meta_master_max}" ] && [ "${OCF_RESKEY_CRM_meta_master_max}" -gt 0 ]
+}
+
 # usage: dirname DIR
 dirname()
 {
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to