Blame SOURCES/bz1744190-pgsql-2-improve-start-checks.patch

42b704
From ac430f79c333d73e6cd59ae59178c7040e7dbfda Mon Sep 17 00:00:00 2001
42b704
From: Kazunori INOUE <kazunori_inoue@newson.co.jp>
42b704
Date: Wed, 8 May 2019 18:23:59 +0900
42b704
Subject: [PATCH] pgsql: enhance checks in pgsql_real_start to prevent
42b704
 incorrect status gets
42b704
42b704
---
42b704
 heartbeat/pgsql | 6 ++++--
42b704
 1 file changed, 4 insertions(+), 2 deletions(-)
42b704
42b704
diff --git a/heartbeat/pgsql b/heartbeat/pgsql
42b704
index 842dc0ac4..5d04618e6 100755
42b704
--- a/heartbeat/pgsql
42b704
+++ b/heartbeat/pgsql
42b704
@@ -483,7 +483,7 @@ runasowner() {
42b704
             "-q")
42b704
                 quietrun="-q"
42b704
                 shift 1;;
42b704
-            "warn"|"err")
42b704
+            "info"|"warn"|"err")
42b704
                 loglevel="-$1"
42b704
                 shift 1;;
42b704
             *)
42b704
@@ -544,7 +544,9 @@ pgsql_real_start() {
42b704
     local postgres_options
42b704
     local rc
42b704
 
42b704
-    if pgsql_status; then
42b704
+    pgsql_real_monitor info
42b704
+    rc=$?
42b704
+    if [ $rc -eq $OCF_SUCCESS -o $rc -eq $OCF_RUNNING_MASTER ]; then
42b704
         ocf_log info "PostgreSQL is already running. PID=`cat $PIDFILE`"
42b704
         if is_replication; then
42b704
             return $OCF_ERR_GENERIC