Create a gist now

Instantly share code, notes, and snippets.

@jesiegel1 /god.conf Secret
Created Jul 22, 2016

What would you like to do?
# god upstart service
description "God process monitoring"
# When to start and stop the service
start on runlevel [2345]
stop on runlevel [016]
# Automatically restart process if crashed
kill timeout 20
respawn
#expect fork
# Start the process
#script
# export RAILS_ENV=staging
# cd /home/root/apps/my_app/current
exec echo "cd /home/root/apps/my_app/current && RAILS_ENV=staging bundle exec god -c config/app.god -D --log log/god.log"
#end script
# god upstart service
description "God process monitoring"
author "you <you@domain.tld>"
usage "..."

start on local-filesystems and net-device-up IFACE!=lo
stop on runlevel [016]

env RAILS_ENV=staging
chdir /home/root/apps/my_app/current

setuid user
setgid group

console log

pre-start script

end script

exec /where/it/is/bundle exec god -c config/app.god -D --log log/god.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment