Fix /var/run directory creation in init.d scripts

XMLWordPrintable

    • Type: Incident report
    • Resolution: Duplicate
    • Priority: Trivial
    • None
    • Affects Version/s: 2.4.7
    • Component/s: Installation (I)
    • None

      On a systemd host like Debian Jessie, if you install the proxy and the agent, the agent can fail to start :

      Dec 17 10:40:45 zabbix-proxy zabbix-agent[487]: mkdir: cannot create directory ‘/var/run/zabbix’: File exists
      Dec 17 10:40:45 zabbix-proxy systemd[1]: zabbix-agent.service: control process exited, code=exited status=1
      Dec 17 10:40:45 zabbix-proxy systemd[1]: Failed to start LSB: Start zabbix-agent daemon.
      Dec 17 10:40:45 zabbix-proxy systemd[1]: Unit zabbix-agent.service entered failed state.
      

      The directory /var/run/zabbix is probably created by the proxy after the test check in the agent init script and the mkdir fails :

      if test ! -d "$DIR"; then
        mkdir "$DIR"
        chown -R zabbix:zabbix "$DIR"
      fi
      

      To fix it add the option -p to mkdir command.

            Assignee:
            Unassigned
            Reporter:
            Boris HUISGEN
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: