diff -r 000382da59a6 heartbeat/.ocf-shellfuncs.in
--- a/heartbeat/.ocf-shellfuncs.in	Thu Oct 07 11:31:30 2010 +0900
+++ b/heartbeat/.ocf-shellfuncs.in	Thu Oct 07 11:43:31 2010 +0900
@@ -332,29 +332,41 @@
 # Usage:   ocf_run <command>
 #
 ocf_run() {
-	local rc
-	local output
-	local verbose=1
-	[ "x$1" = "x-q" ] && {
-		verbose=""
-		shift 1
-	}
-	output=`"$@" 2>&1`
-	rc=$?
-	output=`echo $output`
-	if [ $rc -eq 0 ]; then 
-	    if [ "$verbose" -a ! -z "$output" ]; then
-		ocf_log info "$output"
-	    fi
-	    return $OCF_SUCCESS
-	else
-	    if [ ! -z "$output" ]; then
-		ocf_log err "$output"
-	    else
-		ocf_log err "command failed: $*"
-	    fi
-	    return $rc
-	fi
+        local rc
+        local output
+        local verbose=1
+        local loglevel=err
+
+        for var in 1 2
+        do
+            case "$1" in
+                "-q")
+                    verbose=""
+                    shift 1;;
+                "-info"|"-warn"|"-err")
+                    loglevel=`echo $1 | sed -e s/-//g`
+                    shift 1;;
+                *)
+                    ;;
+            esac
+        done
+
+        output=`"$@" 2>&1`
+        rc=$?
+        output=`echo $output`
+        if [ $rc -eq 0 ]; then
+            if [ "$verbose" -a ! -z "$output" ]; then
+                ocf_log info "$output"
+            fi
+            return $OCF_SUCCESS
+        else
+            if [ ! -z "$output" ]; then
+                ocf_log $loglevel "$output"
+            else
+                ocf_log $loglevel "command failed: $*"
+            fi
+            return $rc
+        fi
 }
 
 ocf_pidfile_status() {
diff -r 000382da59a6 heartbeat/pgsql
--- a/heartbeat/pgsql	Thu Oct 07 11:31:30 2010 +0900
+++ b/heartbeat/pgsql	Thu Oct 07 11:43:31 2010 +0900
@@ -261,12 +261,23 @@
 #
 runasowner() {
     local quietrun=""
-    [ "x$1" = "x-q" ] && {
-		quietrun="-q"
-		shift 1
-	}
+    local loglevel="-err"
 
-    ocf_run $quietrun su $OCF_RESKEY_pgdba -c "cd $OCF_RESKEY_pgdata; $*"
+    for var in 1 2
+    do
+        case "$1" in
+            "-q")
+                quietrun="-q"
+                shift 1;;
+            "warn"|"err")
+                loglevel="-$1"
+                shift 1;;
+            *)
+                ;;
+        esac
+    done
+
+    ocf_run $quietrun $loglevel su $OCF_RESKEY_pgdba -c "cd $OCF_RESKEY_pgdata; $*"
 }
 
 #
@@ -471,7 +482,7 @@
     fi
 
     OCF_RESKEY_monitor_sql=`escape_string "$OCF_RESKEY_monitor_sql"`
-    runasowner -q "$OCF_RESKEY_psql $psql_options -c '$OCF_RESKEY_monitor_sql'"
+    runasowner -q $loglevel "$OCF_RESKEY_psql $psql_options -c '$OCF_RESKEY_monitor_sql'"
 
     rc=$?
     if [ $rc -ne  0 ]; then
