Skip to content

Instantly share code, notes, and snippets.

@poppen
Last active December 18, 2015 04:48
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 poppen/5727699 to your computer and use it in GitHub Desktop.
Save poppen/5727699 to your computer and use it in GitHub Desktop.
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