Skip to content

Instantly share code, notes, and snippets.

@rchampourlier
Created March 16, 2012 13:33
Show Gist options
  • Select an option

  • Save rchampourlier/2050077 to your computer and use it in GitHub Desktop.

Select an option

Save rchampourlier/2050077 to your computer and use it in GitHub Desktop.
Upstart job for god with rbenv
# god
#
# Incomplete Upstart job for God
#
# TODO
# - Find a way to track god (through a pidfile maybe). Maybe this StackOverflow
# answer could help: http://serverfault.com/questions/344989/using-upstart-to-manage-unicorn-w-rbenv-bundler-binstubs-w-ruby-local-exec-s
# - Search for RBENV_VERSION within /home/deployer/.rbenv instead of setting it here.
description "god ruby process monitoring service"
author "Romain Champourlier <romain@softr.li>"
start on runlevel [2345]
stop on runlevel [!2345]
# God is started through rbenv so the process started at first is not the
# long-running daemon. As such, it can't be tracked by Upstart standard way.
# Don't try to get it respawn, since it will always think it has never spawn,
# respawning it endlessly.
#respawn
#respawn limit 10 5
#oom never
#console owner
script
GOD_CONF=/home/deployer/God/main.god
RBENV_VERSION=1.9.2-p290
RBENV_PATH=/home/deployer/.rbenv/shims:/home/deployer/.rbenv/bin
RBENV_VERSION=$RBENV_VERSION PATH=$RBENV_PATH:$PATH god -c /home/deployer/God/main.god
end script
@rchampourlier

rchampourlier commented Jul 18, 2012 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment