sonotdrew/chef-interview — pull request #2 by sonotdrew (2014-04-10 09:56:36+00:00)
Title: both apps now behave on boot and redeploy

The problem was, after boot or chef run/deploy only one app was running. This was caused by this:

```ruby
before_restart do
Dir.chdir(release_path) do
system('killall -9 ruby1.9.1')
end
end
```
There's a few things wrong with this, doing a `killall` on a process name can back fire and effect others process of the same name. First `app_alpha` started up and was happy, then we started to deploy `app_beta` and we came around to this block a second time we killed `app_alpha`. This works if the cookbook is ran on it's own, but ideally one cookbook shouldn't effect other. Secondly you really didn't have to be in the `relase_path` to kill a process :smile:

I think killing process via their ID is a safer way to kill procs, that's why we're also now taking advantage of `rackup`'s ability to manage PID files. From there we can pass the PID of the correct app to `kill`. We get around the first boot problem of there not being a PID number at first run thanks to the `only_if` guard.

In `app_beta` I moved `system('mysqladmin create my_interview_development || echo "Already Created"')` back up in to the before_migrate block. This would have failed had `app_alpha` not created the database before hand.