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']  }}

script
    . $HOME/.virtualenvs/graphite/local/bin/activate
    cd /opt/graphite/webapp/graphite
    exec python manage.py runserver [::]:8081
end script
