summaryrefslogtreecommitdiff
path: root/sys-cluster/galera/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-11-18 10:15:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-11-18 10:15:03 +0000
commitb284a3168fa91a038925d2ecf5e4791011ea5e7d (patch)
tree16fe44748708acacd909d4e2e160a09a7f6d936a /sys-cluster/galera/files
parent77398e424e45d9e98c1cef3c43bdadb9d56e81ef (diff)
gentoo resync : 18.11.2019
Diffstat (limited to 'sys-cluster/galera/files')
-rw-r--r--sys-cluster/galera/files/garb.init35
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}"
+}