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.
This commit is contained in:
Julius Goryavsky 2023-10-17 03:27:11 +02:00
parent eb19638418
commit 073a088f31

View File

@ -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