-
Incident report
-
Resolution: Fixed
-
Minor
-
None
-
None
Zabbix processes like to terminate with incorrect exit codes to indicate failure, also in situations where they did not actually fail. This is a problem on two levels.
The first problem is that this is technically wrong. An exit code should be a small non-negative number, from 0 to 255 on Unix systems. So, if we exit with -1, the exit code gets transformed into 255, since this is how -1 looks when represented as an unsigned byte. The problem with it is that 255 has special meaning (see http://tldp.org/LDP/abs/html/exitcodes.html): exit status out of range, e.g. exit(-1). Ironically, we happen to conform to the standard in this particular case, but it is merely by accident.
The second problem is that sometimes failure is unconventional. According to GNU Coding Standards (http://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html#Command_002dLine-Interfaces), a program if started with --help and --version options should exit successfully. Currently, we indicate failure.