seuros/capistrano-puma — pull request #46 by linjunpop (2014-04-01 13:30:57+00:00)
Title: Make monit play well with chruby.

In my case, with https://github.com/capistrano/chruby

It will generate:

```conf
check process puma_monit_QAirServer
with pidfile "/var/www/QAirServer/shared/tmp/pids/puma.pid"
start program = "/usr/bin/sudo -u vagrant /bin/bash -c 'cd /var/www/QAirServer/current && /usr/local/bin/chruby-exec 2.1.1 -- bundle exec puma -C /var/www/QAirServer/shared/puma.rb'"
stop program = "/usr/bin/sudo -u vagrant /bin/bash -c 'cd /var/www/QAirServer/current && /usr/local/bin/chruby-exec 2.1.1 -- bundle exec pumactl -S /var/www/QAirServer/shared/tmp/pids/puma.state stop'"
````

Not yet test on RVM/rbenv, but it should work by using `SSHKit.config.command_map[:bundle]`

The `/bin/su` will ask for the password, the script will fail.

By setting `NOPASSWD` in `/etc/sudoers` file. `/usr/bin/sudo` will run as expected.