Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
upstart script for tDiary server
description "tdiary-server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn # respawn the service if it dies
respawn limit 5 10 # stop respawning if it fails 5 times in 10 seconds
env PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/bin:/usr/bin:/bin
chdir /path/to/tdiary # Change direcotory
exec su -s /bin/sh -c "bundle exec tdiary server" tdiary-user # Change user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment