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

zabbix_server fails silently when pid file cannot be written

XMLWordPrintable

      When the pid file cannot be created, zabbix_server terminates with exit-code 0 and without any meaningful error message. Following (untested) patch proposal might fix that:

      — src/libs/zbxnix/daemon.c 2014-02-12 09:04:36.000000000 +0000
      +++ src/libs/zbxnix/daemon-new.c 2014-05-16 22:13:19.719068545 +0000
      @@ -203,8 +203,10 @@

      redirect_std(CONFIG_LOG_FILE);

      • if (FAIL == create_pid_file(CONFIG_PID_FILE))
        + if (FAIL == create_pid_file(CONFIG_PID_FILE)) { + zbx_error("Failed to create pid file %s, terminating", CONFIG_PID_FILE); exit(FAIL); + }

      atexit(daemon_stop);

      Note: the process uses exit(FAIL), but since we are after fork of main process, this exit code will not make it to the user. If this behaviour was not desired, a separate bug should be filed.

            Unassigned Unassigned
            ait Roman Fiedler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: