
The pkill executable is provided by the same package that provides ps which is why it is more likely to be installed. Seems that the test VMs don't always have killall installed. Run the MaxScale process with the maxscale user instead of the root user to prevent any new files from being owned by a different user. Cherry-picked the commit a06c122a5e050071589f724758d6bbd3d8d3f419 from develop.
29 lines
423 B
Bash
Executable File
29 lines
423 B
Bash
Executable File
#!/bin/bash
|
|
|
|
sudo systemctl stop maxscale || sudo service maxscale stop
|
|
|
|
hm=`pwd`
|
|
$hm/start_killer.sh &
|
|
if [ $? -ne 0 ] ; then
|
|
exit 1
|
|
fi
|
|
|
|
T="$(date +%s)"
|
|
|
|
sudo maxscale -d -U maxscale
|
|
if [ $? -ne 0 ] ; then
|
|
exit 1
|
|
fi
|
|
|
|
T="$(($(date +%s)-T))"
|
|
echo "Time in seconds: ${T} (including 5 seconds before kill)"
|
|
|
|
if [ "$T" -lt 10 ] ; then
|
|
echo "PASSED"
|
|
exit 0
|
|
else
|
|
echo "FAILED"
|
|
exit 1
|
|
fi
|
|
|