Blame SOURCES/bz1077888-CTDB-fix-logging.patch

15862b
diff --git a/heartbeat/CTDB b/heartbeat/CTDB
15862b
index b23ffae..3e36dd0 100755
15862b
--- a/heartbeat/CTDB
15862b
+++ b/heartbeat/CTDB
15862b
@@ -572,10 +572,22 @@ ctdb_start() {
15862b
 
15862b
 	# Use logfile by default, or syslog if asked for
15862b
-	local log_option="--logfile=$OCF_RESKEY_ctdb_logfile"
15862b
-	if [ "$OCF_RESKEY_ctdb_logfile" = "syslog" ]; then
15862b
-		log_option="--syslog"
15862b
-	elif [ ! -d "$(dirname $OCF_RESKEY_ctdb_logfile)" ]; then
15862b
+	# --logging supported from v4.3.0 and --logfile / --syslog support 
15862b
+	# has been removed from newer versions
15862b
+	version=$(ctdb version | awk '{print $NF}')
15862b
+	ocf_version_cmp "$version" "4.2.14"
15862b
+	if [ "$?" -eq "2" ]; then
15862b
+		log_option="--logging=file:$OCF_RESKEY_ctdb_logfile"
15862b
+		if [ "$OCF_RESKEY_ctdb_logfile" = "syslog" ]; then
15862b
+			log_option="--logging=syslog"
15862b
+		fi
15862b
+	else
15862b
+		log_option="--logfile=$OCF_RESKEY_ctdb_logfile"
15862b
+		if [ "$OCF_RESKEY_ctdb_logfile" = "syslog" ]; then
15862b
+			log_option="--syslog"
15862b
+		fi
15862b
+	fi
15862b
+	if [ ! -d "$(dirname $OCF_RESKEY_ctdb_logfile)" ]; then
15862b
 		# ensure the logfile's directory exists, otherwise ctdb will fail to start
15862b
 		mkdir -p $(dirname $OCF_RESKEY_ctdb_logfile)
15862b
 	fi