description "CIRCLE Storage Driver Celery Upstart"

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

respawn
respawn limit 30 30
setgid cloud
setuid cloud

chdir /home/cloud/storagedriver

script
    . /home/cloud/.virtualenvs/storage/local/bin/activate
    . /home/cloud/.virtualenvs/storage/local/bin/postactivate
    HOSTNAME=$(hostname -s)
    exec celery -A storagecelery worker --loglevel=info -n ${HOSTNAME}.storage
end script