description "CIRCLE Cloud Graphite monitoring server"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 30 30
setgid {{ pillar['graphite']['user']  }}
setuid {{ pillar['graphite']['user']  }}

env HOME=/home/{{ pillar['graphite']['user']  }}
env GRAPHITE_ROOT=/opt/graphite
env PYTHONPATH=/opt/graphite/lib


script
    . $HOME/.virtualenvs/graphite/local/bin/activate
    cd /opt/graphite/bin/
    exec twistd --nodaemon --reactor=epoll --no_save carbon-cache 
end script
