diff options
Diffstat (limited to 'sys-cluster/galera/files/garb.init')
-rw-r--r-- | sys-cluster/galera/files/garb.init | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sys-cluster/galera/files/garb.init b/sys-cluster/galera/files/garb.init new file mode 100644 index 000000000000..5bf57a7a683e --- /dev/null +++ b/sys-cluster/galera/files/garb.init @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/bin/garbd" +pidfile="${PIDFILE:-/var/run/garbd}" +command_background="yes" +command_args="" +command_user="nobody" + +depend() { + use net + after mysql +} + +start_pre() { + if [ -z "${GALERA_NODES}" ]; then + eerror "List of GALERA_NODES is not configured" + return 1 + fi + + if [ -z "${GALERA_GROUP}" ]; then + eerror "GALERA_GROUP name is not configured" + return 1 + fi + + GALERA_PORT=${GALERA_PORT:-4567} + + local OPTIONS="-a gcomm://${GALERA_NODES// /,} -g ${GALERA_GROUP}" + [ -n "${GALERA_OPTIONS}" ] && OPTIONS="${OPTIONS} -o ${GALERA_OPTIONS}" + [ -n "${LOG_FILE}" ] && OPTIONS="${OPTIONS} -l ${LOG_FILE}" + [ -n "${NODE_NAME}" ] && OPTIONS="${OPTIONS} -n ${NODE_NAME}" + + command_args="${OPTIONS}" +} |