diff options
Diffstat (limited to 'app-metrics/go-carbon/files')
-rw-r--r-- | app-metrics/go-carbon/files/go-carbon.confd | 8 | ||||
-rw-r--r-- | app-metrics/go-carbon/files/go-carbon.initd | 44 |
2 files changed, 52 insertions, 0 deletions
diff --git a/app-metrics/go-carbon/files/go-carbon.confd b/app-metrics/go-carbon/files/go-carbon.confd new file mode 100644 index 000000000000..41e5838dd249 --- /dev/null +++ b/app-metrics/go-carbon/files/go-carbon.confd @@ -0,0 +1,8 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +#CONFIG_FILE=/etc/go-carbon/go-carbon.conf + +# user and group to run go-carbon as +#USER=carbon +#GROUP=carbon diff --git a/app-metrics/go-carbon/files/go-carbon.initd b/app-metrics/go-carbon/files/go-carbon.initd new file mode 100644 index 000000000000..b45a1a5a5d17 --- /dev/null +++ b/app-metrics/go-carbon/files/go-carbon.initd @@ -0,0 +1,44 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Graphite whisper metrics storage and retrieval server." + +carbonapi_config=${CONFIG_FILE:-/etc/go-carbon/${SVCNAME}.conf} + +command="/usr/bin/go-carbon" +command_args="-config ${carbonapi_config}" +pidfile="/run/go-carbon/${SVCNAME}.pid" +user=${USER:-carbon} +group=${GROUP:-carbon} + +depend() { + need net + use dns +} + +start_pre() { + mkdir -p "${pidfile%/*}" + mkdir -p /var/log/go-carbon + chown ${user}:${group} "${pidfile%/*}" /var/log/go-carbon +} + +stop_post() { + rm -f "${pidfile}" +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --pidfile "${pidfile}" \ + --make-pidfile --background \ + --user ${user} --group ${group} \ + --exec ${command} -- \ + ${command_args} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec ${command} --pidfile "${pidfile}" + eend $? +} |