Commit 073a088f authored by Julius Goryavsky's avatar Julius Goryavsky

MDEV-31467: wsrep_sst_mariabackup not working on FreeBSD

Due to the different command line format of the timeout
utility on FreeBSD and Linux, SST scripts for mariabackup
may not work on FreeBSD. This commit fixes this problem
by adding a different command to test options on FreeBSD
and adding proper formatting for the utility options.
parent eb196384
......@@ -798,10 +798,20 @@ recv_joiner()
local ltcmd="$tcmd"
if [ $tmt -gt 0 ]; then
if [ -n "$(commandex timeout)" ]; then
if timeout --help | grep -qw -F -- '-k'; then
local koption=0
if [ "$OS" = 'FreeBSD' ]; then
if timeout 2>&1 | grep -qw -F -- '-k'; then
koption=1
fi
else
if timeout --help | grep -qw -F -- '-k'; then
koption=1
fi
fi
if [ $koption -ne 0 ]; then
ltcmd="timeout -k $(( tmt+10 )) $tmt $tcmd"
else
ltcmd="timeout -s9 $tmt $tcmd"
ltcmd="timeout -s 9 $tmt $tcmd"
fi
fi
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment