plathrop / puppet-module-supervisor

Puppet module for configuring the supervisor daemon tool.
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

make start/stop/restart return sensible error codes too, like status #38

Closed superawesome closed 11 years ago

superawesome commented 11 years ago

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.

plathrop commented 11 years ago

This is tested and working for you? I don't use this module anywhere anymore so it is difficult for me to test, but if it is working for you, I'm happy to merge.

superawesome commented 11 years ago

Yep! We don't use your module exactly, but this particular chunk of lines is nearly identical to ours (just different variable names) so I'm confident that it works.

aljungberg commented 11 years ago

This change required a minor tweak to work for us - see #50.