summaryrefslogtreecommitdiff
path: root/dev-python/carbon/files
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/carbon/files
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-python/carbon/files')
-rw-r--r--dev-python/carbon/files/carbon.confd5
-rw-r--r--dev-python/carbon/files/carbon.initd51
-rw-r--r--dev-python/carbon/files/carbon.initd253
3 files changed, 109 insertions, 0 deletions
diff --git a/dev-python/carbon/files/carbon.confd b/dev-python/carbon/files/carbon.confd
new file mode 100644
index 000000000000..b1875e134678
--- /dev/null
+++ b/dev-python/carbon/files/carbon.confd
@@ -0,0 +1,5 @@
+# Use the given config file
+CARBON_CONFIG="/etc/carbon/carbon.conf"
+
+# Add extra parameters
+CARBON_EXTRA_PARAMETERS=""
diff --git a/dev-python/carbon/files/carbon.initd b/dev-python/carbon/files/carbon.initd
new file mode 100644
index 000000000000..a33a70c60f93
--- /dev/null
+++ b/dev-python/carbon/files/carbon.initd
@@ -0,0 +1,51 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+export GRAPHITE_CONF_DIR=/etc/carbon
+export GRAPHITE_STORAGE_DIR=/var/lib/carbon
+
+INSTANCE=${SVCNAME/#*.}
+if [ "${INSTANCE}" == "${SVCNAME}" ]; then
+ INSTANCE="a"
+fi
+
+PIDFILE="/var/run/${SVCNAME}.pid"
+PROGRAMNAME=${SVCNAME/.*}
+
+CARBON_CONFIG=${CARBON_CONFIG:-/etc/carbon/carbon.conf}
+
+depend() {
+ use net
+}
+
+
+start_pre() {
+ if [ ! -f ${CARBON_CONFIG} ] ; then
+ eend "Missing ${CARBON_CONFIG}"
+ fi
+ case "${PROGRAMNAME}" in
+ "carbon-relay" )
+ [ -f /etc/carbon/relay-rules.conf ] || eend "Missing relay-rules.conf"
+ ;;
+ "carbon-aggregator" )
+ [ -f /etc/carbon/aggregation-rules.conf ] || eend "Missing missing aggregation-rules.conf"
+ ;;
+ esac
+}
+
+start() {
+ ebegin "Starting ${PROGRAMNAME} instance ${INSTANCE}"
+ start-stop-daemon --start --exec /usr/bin/${PROGRAMNAME}.py \
+ --pidfile ${PIDFILE} \
+ -- --pidfile ${PIDFILE} --instance ${INSTANCE} \
+ --logdir /var/log/carbon/ --config ${CARBON_CONFIG} start >/dev/null
+ eend $? "Failed to start ${SVCNAME}"
+}
+
+stop() {
+ ebegin "Stopping ${PROGRAMNAME} instance ${INSTANCE}"
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE}
+ eend $? "Failed to stop ${SVCNAME}"
+}
diff --git a/dev-python/carbon/files/carbon.initd2 b/dev-python/carbon/files/carbon.initd2
new file mode 100644
index 000000000000..ff1509747ef1
--- /dev/null
+++ b/dev-python/carbon/files/carbon.initd2
@@ -0,0 +1,53 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+export GRAPHITE_CONF_DIR=/etc/carbon
+export GRAPHITE_STORAGE_DIR=/var/lib/carbon
+
+INSTANCE=${SVCNAME#*.}
+if [ "${INSTANCE}" = "${SVCNAME}" ]; then
+ INSTANCE="a"
+fi
+
+PIDFILE="/var/run/${SVCNAME}.pid"
+PROGRAMNAME=${SVCNAME%%.*}
+
+CARBON_CONFIG=${CARBON_CONFIG:-/etc/carbon/carbon.conf}
+
+depend() {
+ use net
+}
+
+
+start_pre() {
+ if [ ! -f ${CARBON_CONFIG} ] ; then
+ eend "Missing ${CARBON_CONFIG}"
+ fi
+ case "${PROGRAMNAME}" in
+ "carbon-relay" )
+ if `grep -q "^RELAY_METHOD = rules$" ${CARBON_CONFIG}`; then
+ [ -f /etc/carbon/relay-rules.conf ] || eend "Missing relay-rules.conf"
+ fi
+ ;;
+ "carbon-aggregator" )
+ [ -f /etc/carbon/aggregation-rules.conf ] || eend "Missing missing aggregation-rules.conf"
+ ;;
+ esac
+}
+
+start() {
+ ebegin "Starting ${PROGRAMNAME} instance ${INSTANCE}"
+ start-stop-daemon --start --exec /usr/bin/${PROGRAMNAME}.py \
+ --pidfile ${PIDFILE} \
+ -- --pidfile ${PIDFILE} --instance ${INSTANCE} \
+ --logdir /var/log/carbon/ --config ${CARBON_CONFIG} start >/dev/null
+ eend $? "Failed to start ${SVCNAME}"
+}
+
+stop() {
+ ebegin "Stopping ${PROGRAMNAME} instance ${INSTANCE}"
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE}
+ eend $? "Failed to stop ${SVCNAME}"
+}