Created
August 11, 2020 00:43
-
-
Save markizano/5ce52a13e6d7c829f259c8344966e3ac to your computer and use it in GitHub Desktop.
Graphite's Carbon Cache init script written for OpenRC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/openrc-run | |
# 2020-08-10: @markizano | |
# Written by inference from https://wiki.gentoo.org/wiki/Handbook:X86/Working/Initscripts | |
# and https://gist.github.com/chalmerj/1492384 | |
user=${CARBON_USER:-graphite} | |
group=${CARBON_GROUP:-apps} | |
description="An init script for Graphite's carbon-cache daemon." | |
pidfile=${CARBON_PIDFILE:-"/run/carbon-cache.pid"} | |
command="${CARBON_BIN:-"/usr/local/bin/carbon-cache.py"}" | |
command_args="--syslog --umask=0022 --config=${CARBON_CONFIGFILE:-"/etc/carbon/carbon-cache.conf"} --pidfile=${pidfile}" | |
start_stop_daemon_args=${CARBON_SSDARGS:-"--wait 1000"} | |
retry=${CARBON_TERMTIMEOUT:-"TERM/60/KILL/5"} | |
depend() { | |
need net | |
use dns logger netmount | |
} | |
stop_post() { | |
rm -f ${pidfile} | |
} | |
start() { | |
ebegin "Starting ${DAEMON:-"carbon-cache"}" | |
${command} ${command_args} start | |
eend $? "failed" | |
} | |
stop() { | |
ebegin "Stopping ${DAEMON:-"carbon-cache"}" | |
${command} ${command_args} stop | |
eend $? "failed" | |
} | |
status() { | |
ebegin "Checking ${DAEMON:-"carbon-cache"}" | |
${command} ${command_args} status | |
eend $? "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment