elm-city-craftworks/practicing-ruby-cookbook — pull request #7 by mlafeldt (2013-11-01 13:22:28+00:00)
Title: Unicorn not started when booting

When (re)booting the Vagrant box, Unicorn isn't started automatically.

To fix this manually, we either have to deploy again with Capistrano or simply run:

```sh
practicing-ruby-web (master)]$ cap vagrant unicorn:start
triggering load callbacks
* 2013-10-30 12:14:03 executing `vagrant'
triggering start callbacks for `unicorn:start'
* 2013-10-30 12:14:03 executing `multistage:ensure'
* 2013-10-30 12:14:03 executing `unicorn:start'
triggering before callbacks for `unicorn:start'
* executing "if [ -e \"/home/deploy/current/config/unicorn.rb\" ]; then\\\n UNICORN_CONFIG_PATH=/home/deploy/current/config/unicorn.rb;\\\n else\\\n if [ -e \"/home/deploy/current/config/unicorn/production.rb\" ]; then\\\n UNICORN_CONFIG_PATH=/home/deploy/current/config/unicorn/production.rb;\\\n else\\\n echo \"Config file for \"production\" environment was not found at either \"/home/deploy/current/config/unicorn.rb\" or \"/home/deploy/current/config/unicorn/production.rb\"\";\\\n exit 1;\\\n fi;\\\n fi;\\\n\\\n if [ -e \"/home/deploy/shared/pids/unicorn.pid\" ]; then\\\n if kill -0 `cat /home/deploy/shared/pids/unicorn.pid` > /dev/null 2>&1; then\\\n echo \"Unicorn is already running!\";\\\n exit 0;\\\n fi;\\\n\\\n rm /home/deploy/shared/pids/unicorn.pid;\\\n fi;\\\n\\\n echo \"Starting Unicorn...\";\\\n cd /home/deploy/current && RAILS_ENV=production BUNDLE_GEMFILE=/home/deploy/current/Gemfile bundle exec unicorn -c $UNICORN_CONFIG_PATH -E deployment -D ;"
servers: ["practicingruby.local"]
[practicingruby.local] executing command
** [out :: practicingruby.local] Starting Unicorn...
command finished in 2409ms
```

@sandal Maybe it's a good idea to have a startup script that takes care of starting Unicorn for us, similar to what I've done for God (#6).