Skip to content

Instantly share code, notes, and snippets.

@rchampourlier
Created March 16, 2012 13:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rchampourlier/2050077 to your computer and use it in GitHub Desktop.
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
@1st8
Copy link

1st8 commented Jul 17, 2012

Hey,

I used your file as an inspiration for my god upstart job.
I was able to fix both your TODOs, so you might be interested:
https://gist.github.com/3128135

Regards
Christoph

@rchampourlier
Copy link
Author

rchampourlier commented Jul 18, 2012 via email

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