diff options
author | Fabian Groffen <grobian@gentoo.org> | 2017-04-29 12:40:45 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2017-04-29 12:40:45 +0200 |
commit | 9342556588081817302a677e071a271b505ba7c8 (patch) | |
tree | 2838ce9abc5cc9477b843ed488a7766ac8aaed43 /app-misc/carbon-c-relay/files | |
parent | dev-perl/HTML-Object: Fix tests dependent on system timezone (diff) | |
download | gentoo-9342556588081817302a677e071a271b505ba7c8.tar.gz gentoo-9342556588081817302a677e071a271b505ba7c8.tar.bz2 gentoo-9342556588081817302a677e071a271b505ba7c8.zip |
app-misc/carbon-c-relay: version bump to 3.1
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'app-misc/carbon-c-relay/files')
-rw-r--r-- | app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 | 18 | ||||
-rw-r--r-- | app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 | 70 |
2 files changed, 88 insertions, 0 deletions
diff --git a/app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 b/app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 new file mode 100644 index 000000000000..64e4ab5c832e --- /dev/null +++ b/app-misc/carbon-c-relay/files/carbon-c-relay.confd-r1 @@ -0,0 +1,18 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# routing file to read +#ROUTES_FILE=/etc/carbon-c-relay.conf + +# where to store the PID-file +#PIDFILE=/run/carbon-c-relay.pid + +# where to store the logfile +#LOGFILE=/var/log/carbon-c-relay.log + +# user and group to run carbon-c-relay as +#USER=carbon +#GROUP=carbon + +# any options to use when starting the relay +#EXTRA_OPTS= diff --git a/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 b/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 new file mode 100644 index 000000000000..104a7e0878e9 --- /dev/null +++ b/app-misc/carbon-c-relay/files/carbon-c-relay.initd-r1 @@ -0,0 +1,70 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="configtest" +extra_started_commands="reload" + +description="Lightweight graphite metrics router and aggregator." +description_configtest="Run carbon-c-relay's internal config check." +description_reload="Reload the carbon-c-relay configuration without losing connections." + +routes_config=${ROUTES_FILE:-/etc/${SVCNAME}.conf} + +command="/usr/bin/carbon-c-relay" +command_args="-f ${routes_config} ${EXTRA_OPTS}" +pidfile=${PIDFILE:-/run/${SVCNAME}.pid} +logfile=${LOGFILE:-/var/log/${SVCNAME}.log} +user=${USER:-carbon} +group=${GROUP:-carbon} + +depend() { + need net + use dns +} + +start_pre() { + if [ "${RC_CMD}" != "restart" ]; then + configtest || return 1 + fi + touch "${logfile}" + chown ${user}:${group} "${logfile}" +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + configtest || return 1 + fi +} + +stop_post() { + rm -f "${pidfile}" +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --pidfile "${pidfile}" \ + --user ${user} --group ${group} \ + --exec ${command} -- -D -P "${pidfile}" -l "${logfile}" \ + ${command_args} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec ${command} --pidfile "${pidfile}" + eend $? +} + +reload() { + configtest || return 1 + ebegin "Refreshing ${SVCNAME}'s configuration" + kill -HUP $(< "${pidfile}") &>/dev/null + eend $? "Failed to reload ${SVCNAME}" +} + +configtest() { + ebegin "Checking ${SVCNAME}'s configuration" + ${command} -f "${routes_config}" -t < /dev/null > /dev/null + eend $? "failed, please correct errors above" +} |