File 0010-High-CTDB-Don-t-fail-on-empty-directory-bsc-1052577.patch of Package resource-agents.10310

From 24a5b8dd76611d23e5071cec5c7be147ce9d7dbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Mon, 7 Aug 2017 14:46:55 +0200
Subject: [PATCH] High: CTDB: Don't fail on empty directory (bsc#1052577)

Commit 4c9a39d834 introduced a bug which causes the agent
to fail with a database corrupted error if the /persistent
directory is empty.
---
 heartbeat/CTDB | 1 +
 1 file changed, 1 insertion(+)

diff --git a/heartbeat/CTDB b/heartbeat/CTDB
index 3e36dd0d..709dbc8e 100755
--- a/heartbeat/CTDB
+++ b/heartbeat/CTDB
@@ -553,6 +553,7 @@ ctdb_start() {
 	persistent_db_dir="${OCF_RESKEY_ctdb_dbdir}/persistent"
 	mkdir -p $persistent_db_dir 2>/dev/null
 	for pdbase in $persistent_db_dir/*.tdb.[0-9]; do
+		[ -f "$pdbase" ] || break
 		/usr/bin/tdbdump "$pdbase" >/dev/null 2>/dev/null || {
 			ocf_exit_reason "Persistent database $pdbase is corrupted!  CTDB will not start."
 			return $OCF_ERR_GENERIC
-- 
2.13.2

openSUSE Build Service is sponsored by