You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
1.1 KiB

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