opscode/cookbooks — pull request #244 by mrflip (2011-11-21 06:35:06+00:00)
Title: runit `status` exit codes don't behave the way the service resource wants it to

This makes notifying runit resources flaky: the system will think they are running when in fact they are down.

The [exit code of sv(8)](http://smarden.org/runit/sv.8.html) is 0 when invoked directly (i.e. as `/usr/bin/sv`) and the *command* was successful: that is, it found out the status of the program (whatever it was). Using `/usr/bin/sv check` doesn't help either: its exit code is 0 when the service's status is the last thing I asked for (so, if I `service foo stop`, check returns 0 if the service is stopped, regardless of what chef thinks it should be).

When invoked with "a base name other than sv" (e.g. as `service`) it gives the desired exit code behavior. This is hacky but fixes the issue on ubuntu.