Skip to content

Instantly share code, notes, and snippets.

@avdept
Last active February 8, 2017 13:09
Show Gist options
  • Save avdept/696741cde96c6c53c9711910d81361f0 to your computer and use it in GitHub Desktop.
Save avdept/696741cde96c6c53c9711910d81361f0 to your computer and use it in GitHub Desktop.
#!/bin/sh -e
# upstart-job
# Put file into /etc/init.d
# Service available as sudo service {filename} start
# Make sure you chmod +x file
# To add service to auto start -> sudo update-rc.d {filename} defaults
echo "starting unicorn after reboot"
exec sudo -u ubuntu bash -c "cd /home/ubuntu/apps/app_name/prod/current && ~/.rvm/bin/rvm default do bundle exec unicorn_rails -c /home/ubuntu/apps/app_name/prod/current/config/unicorn/production.rb -E production -D"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment