cargomedia/puppet-packages — pull request #532 by njam (2014-03-18 09:01:04+00:00)
Title: bipbip init.d-script cannot find binary when called from monit

In `/etc/init.d/bipbip` we detect the binary's path with `DAEMON=$(which bipbip)`.
When monit is executing this script the binary cannot be found because the PATH is set to `/bin:/usr/bin:/sbin:/usr/sbin`.

This is probably happening since we upgraded to ruby 1.9, which stores binaries in `/usr/local/bin` (compared to `/usr/bin` with ruby 1.8's rubygems).

Ideas:
- Detect gem binary path with `/usr/bin/gem env` (output: ` - EXECUTABLE DIRECTORY: /usr/local/bin`
- Detect actual gem binary path with `ruby -e "puts Gem.bin_path('bipbip', 'bipbip')"` (output: `/var/lib/gems/1.9.1/gems/bipbip-0.2.6/bin/bipbip`
- Ensure broader `$PATH` either in the init script or in monit

@kris-lab @tomaszdurka opinions?