-
Problem report
-
Resolution: Fixed
-
Critical
-
4.4.7, 5.0.0beta1
-
System Version: macOS 10.15.4 (19E287)
-
Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021), Sprint 74 (Mar 2021)
-
1
At least when a system update happens, the /var/log/zabbix directory gets removed. As the agent is run as the zabbix user, its stdout and stderr cannot be redirected to /var/log/zabbix/zabbix_agentd-out.log respectively /var/log/zabbix/zabbix_agentd-err.log as configured in the com.zabbix.zabbix_agentd.plist LaunchDaemon definition. It then crashes with
com.apple.xpc.launchd[1] (com.zabbix.zabbix_agentd[96163]): Service exited with abnormal code: 78
I'm not sure if this only happens during updates, but the behavior can be simulated by deleting the /var/log/zabbix directory. When modifying com.zabbix.zabbix_agentd.plist so that zabbix_agent is invoked with root permissions, the /var/log/zabbix/ directory is created, but then it drops its privileges and dies because it can't write to /var/log/zabbix/zabbix_agentd.log:
zabbix_agentd [96289]: cannot open log: unable to open log file [/var/log/zabbix/zabbix_agentd.log]: [13] Permission denied
As soon as one creates the /var/log/zabbix/ directory with user zabbix as owner, the agent works immediately, e.g.
sudo mkdir -p /var/log/zabbix sudo chown -R zabbix /var/log/zabbix