/usr/bin/garb-systemd is in percona-galera-arbitrator-3 3.21-0ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #!/bin/bash -ue
#
if [ -f /etc/sysconfig/garb ]; then
config=/etc/sysconfig/garb
elif [ -f /etc/default/garb ]; then
config=/etc/default/garb
else
log_failure "Garbd configuration file not found"
return 6
fi
log_failure() {
echo " ERROR! $@"
}
program_start() {
echo "Starting garbd"
/usr/bin/garbd "$@"
}
start() {
if grep -q -E '^# REMOVE' $config;then
log_failure "Garbd config $config is not configured yet"
return 0
fi
# Check that node addresses are configured
if [[ -z "${GALERA_NODES:-}" ]]; then
log_failure "List of GALERA_NODES is not configured"
return 6
fi
if [[ -z "${GALERA_GROUP:-}" ]]; then
log_failure "GALERA_GROUP name is not configured"
return 6
fi
GALERA_PORT=${GALERA_PORT:-4567}
OPTIONS="-a gcomm://${GALERA_NODES// /,}"
# substitute space with comma for backward compatibility
[ -n "${GALERA_GROUP:-}" ] && OPTIONS="$OPTIONS -g '$GALERA_GROUP'"
[ -n "${GALERA_OPTIONS:-}" ] && OPTIONS="$OPTIONS -o '$GALERA_OPTIONS'"
[ -n "${LOG_FILE:-}" ] && OPTIONS="$OPTIONS -l '$LOG_FILE'"
eval program_start $OPTIONS
}
# See how we were called.
case "$1" in
start)
start
;;
*)
echo $"Usage: $0 {start}"
exit 2
esac
exit $?
|