Have broctl return useful exit codes

Description

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.

Environment

None

Activity

Show:
Seth Hall
May 10, 2013, 7:16 PM

Daniel, have you taken a look yet?

Daniel Thayer
May 11, 2013, 12:37 AM

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?

Vlad Grigorescu
May 13, 2013, 1:56 PM

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.

Daniel Thayer
May 22, 2013, 10:21 PM

In [changeset:4274c596d7429c299467130d8816ea97aebe25bc/broctl]:

Daniel Thayer
July 30, 2013, 6:44 PM

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")

Merged

Assignee

Daniel Thayer

Reporter

Vlad Grigorescu

Labels

None

External issue ID

920

Components

Fix versions

Affects versions

Priority

Normal
Configure