Blob Blame History Raw
From 34b2d8ab82dcdf49535c74e6a580240455498759 Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Wed, 2 Dec 2020 22:51:33 +0100
Subject: [PATCH] default to syncing with sbd

---
 lib/common/watchdog.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/common/watchdog.c b/lib/common/watchdog.c
index 03ee7f1..bf5df18 100644
--- a/lib/common/watchdog.c
+++ b/lib/common/watchdog.c
@@ -244,12 +244,16 @@ pcmk__get_sbd_timeout(void)
 bool
 pcmk__get_sbd_sync_resource_startup(void)
 {
-    static bool sync_resource_startup = false;
+    static bool sync_resource_startup = true; // default overruled by env
     static bool checked_sync_resource_startup = false;
 
     if (!checked_sync_resource_startup) {
-        sync_resource_startup =
-            crm_is_true(getenv("SBD_SYNC_RESOURCE_STARTUP"));
+        gboolean ret = FALSE;
+        const char *s = getenv("SBD_SYNC_RESOURCE_STARTUP");
+
+        if ((s != NULL) && (crm_str_to_boolean(s, &ret) > 0)) {
+            sync_resource_startup = ret;
+        }
         checked_sync_resource_startup = true;
     }
 
-- 
1.8.3.1