Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-2196

zabbix uses unconventional exit codes

    XMLWordPrintable

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0
    • Component/s: Server (S)
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            asaveljevs Aleksandrs Saveljevs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: