Skip to content

Instantly share code, notes, and snippets.

@veverkap
Forked from acdha/carbon-cache.conf
Created October 23, 2012 04:22
Show Gist options
  • Select an option

  • Save veverkap/3936628 to your computer and use it in GitHub Desktop.

Select an option

Save veverkap/3936628 to your computer and use it in GitHub Desktop.
Upstart config for Graphite's carbon-cache daemon
#!/etc/init/carbon-cache.conf
description "Carbon server"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
umask 022
expect daemon
respawn
pre-start script
test -d /opt/graphite || { stop; exit 0; }
end script
chdir /opt/graphite
# Note the use of a wrapper so we can activate our virtualenv:
exec start-stop-daemon --oknodo --chdir /opt/graphite --user graphite --chuid graphite --pidfile /opt/graphite/storage/carbon-cache-a.pid --name carbon-cache --startas /opt/graphite/bin/run-carbon-cache.sh --start start
#!/bin/sh
set -e
HOME=/opt/graphite
. /opt/graphite/.virtualenv/bin/activate
. /opt/graphite/.virtualenv/bin/postactivate
exec /opt/graphite/bin/carbon-cache.py "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment