I've got a broctl branch here: https://github.com/grigorescu/broctl which aims to have it return a 0 or 1 exit code for most execution paths. My dive down this particular rabbit hole started when I wanted to have status return a non-zero exit code if a node had failed, but I tried to cover everything else while I was at it.
If someone could double-check it, to make sure that I didn't miss anything, it'd be much appreciated.
Daniel, have you taken a look yet?
Replying to [grigorescu|BIT-920]:
> I've got a broctl branch here: https://github.com/grigorescu/broctl which aims to have it return a 0 or 1 exit code for most execution paths. My dive down this particular rabbit hole started when I wanted to have status return a non-zero exit code if a node had failed, but I tried to cover everything else while I was at it.
>
> If someone could double-check it, to make sure that I didn't miss anything, it'd be much appreciated.
Which branch contains these changes?
Oops
- sorry about that. It got lost when I was doing some shuffling.
The branch is here: https://github.com/grigorescu/broctl/tree/remotes/origin/topic/vladg/exit-codes and the relevant commit is: https://github.com/grigorescu/broctl/commit/a37d4690a12ad976351c7cef6188d64f601c2f58
Please let me know if I missed anything, or if the approach I took doesn't seem reasonable. Thanks.
In [changeset:4274c596d7429c299467130d8816ea97aebe25bc/broctl]:
In branch topic/dnthayer/bug920, I've made some small fixes to the patch,
and added support to broctl commands that were missed by the original
patch. The only remaining issues I see are:
1) "broctl cron" always returns 0 (this might not matter, because
the return value doesn't affect the emails that cron sends),
2) "broctl status" and "broctl top" return 0 if all bro nodes are running,
and returns 1 otherwise (to me, this seems inconsistent with the
other commands, where a non-zero return value indicates some
error occurred),
3) there is no mechanism to return non-zero for a command provided
by a broctl plugin (such as "broctl ps.bro")