Skip to content

Instantly share code, notes, and snippets.

@2called-chaos
Created January 14, 2013 23:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2called-chaos/4534381 to your computer and use it in GitHub Desktop.
Save 2called-chaos/4534381 to your computer and use it in GitHub Desktop.
Start rails application on startup. Insert this into /etc/rc.local before the line "exit 0" (do not remove the shebang/1st line either). Change basepath and webuser respectively.
# Insert this into /etc/rc.local before the line "exit 0" (do not remove the shebang/1st line either)
# Change basepath and webuser respectively.
rails_start() { screen -md su - www-data -c "cd /home/www/$1/current ; bundle exec unicorn -c config/unicorn.rb -E production -D"; }
rails_start "com.example"
rails_start "some_app"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment