plathrop/puppet-module-supervisor — pull request #38 by superawesome (2013-06-24 21:41:01+00:00)
Title: make start/stop/restart return sensible error codes too, like status

supervisorctl appears to return "0" all the time, not just for the status command. This means that puppet can't tell when the service failed to start, or failed to stop. It will of course try again next time puppet runs, but you'll never get a report of the problem.

I followed the pattern already set for "status". The only one that's a little weird is "restart", because it's multi-line. This is fairly simple to resolve with "grep -Pzo", but other methods exist too... sed or awk can probably do this just as well. I'm not sure if there's any good reason to prefer one method over another.