Skip to content

Instantly share code, notes, and snippets.

@dennisfaust
Created November 8, 2012 19:37
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 dennisfaust/4041026 to your computer and use it in GitHub Desktop.
Save dennisfaust/4041026 to your computer and use it in GitHub Desktop.
Using Upstart to keep God process monitor up under RVM
# 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
# Don't use expect fork with -D below
#expect fork
# Start the process
script
export RAILS_ENV=staging
cd /home/YOUR_USER_PATH
#
# NOTE: Explanation of command and flags below
#
# -D run in the foreground, this gives a god process in the processlist
# -P put the PID in this file. May need to be deleted if god crashes <shudder>
# -c config file
# --log this is where god's log entries go, the workers log files are set in the resque config file.
#
# bootup_god - https://rvm.io/integration/god/
# bootup_god create command: rvm wrapper ruby-1.9.3-p194 bootup god
#
/usr/local/rvm/bin/bootup_god -D -P /var/run/god -c /home/YOUR_USER_PATH/config/resque.god.rb --log /var/log/god.log
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment