Created
December 29, 2012 14:33
-
-
Save namxam/4407243 to your computer and use it in GitHub Desktop.
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
description "Your App" | |
author "Maximilian Schulz <[email protected]>" | |
# Define when to run the app | |
start on (local-filesystems and runlevel [2345]) | |
stop on runlevel [016] | |
# Default config | |
respawn | |
respawn limit 10 5 | |
# App configuration | |
env APP_NAME=your_app | |
env APP_HOME=/var/rails/your_app | |
env APP_USER=your_app_user | |
# Ensure that some directories are available | |
pre-start script | |
# Create folder for logs and adjust ownership | |
mkdir -p /var/log/$APP_NAME | |
chown -R $APP_USER:www-data /var/log/$APP_NAME | |
end script | |
# Run the server by utilizing ubuntus's start-stop-daemon | |
exec start-stop-daemon \ | |
--start \ | |
--pidfile /var/run/thin/$APP_NAME.pid \ | |
--chuid $APP_USER:www-data \ | |
--chdir $APP_HOME \ | |
--exec /home/$APP_USER/.rvm/bin/rvm-shell -- ruby-1.9.3-p194 -c 'bundle exec rails server' | |
respawn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment