thuehlinger / daemons

Ruby daemons gem official repository
MIT License
648 stars 71 forks source link

When daemon is not running, status subcommand exit in non-zero status #11

Closed thuehlinger closed 10 years ago

thuehlinger commented 10 years ago

I'd like to have Daemons return non-zero value when I try status subcommand for a not-working daemon. Right now, the status subcommand always exit by the status '0'. Normally, the status subcommand would exit by the status '3' when the daemon is not running. I hope Daemons be the same.

As far as I see the source code, it may require not-so-small change, so I created this issue on "Feature Request".

sodabrew commented 10 years ago

Would this be at Daemons::Controller.run:

     def run
       ...
       when 'status'
         unless @group.applications.empty?
           @group.show_status
         else
           puts "#{@group.app_name}: no instances running"
         end

I suppose the simplest implementation is to add exit 3 after that puts.