Skip to content

Instantly share code, notes, and snippets.

@jesiegel1
Created July 22, 2016 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesiegel1/2ba88ccff85001f3be57c2e2debca893 to your computer and use it in GitHub Desktop.
Save jesiegel1/2ba88ccff85001f3be57c2e2debca893 to your computer and use it in GitHub Desktop.
# 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
@AnrDaemon
Copy link

# 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