Created
November 8, 2012 19:37
-
-
Save dennisfaust/4041026 to your computer and use it in GitHub Desktop.
Using Upstart to keep God process monitor up under RVM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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