Zabbix agentd creates its log file owned by root. Later, when running as user zabbix, agentd cannot open or write to that file.
When logging to a file, Zabbix agentd opens and closes the log file immediately after reading the configuration file. If no previous log file exists, a new file is created with the current owner and group: root and root on Gentoo.
Later, agentd executes setuid and setgid to set the appropriate process owner and group, typically zabbix and zabbix. Now it can no longer open its log file.
Workaround: Assure that a log file exists with the appropriate owner prior to running zabbix_agentd:
When logging to a file, Zabbix agentd opens and closes the log file immediately after reading the configuration file. If no previous log file exists, a new file is created with the current owner and group: root and root on Gentoo.
Later, agentd executes setuid and setgid to set the appropriate process owner and group, typically zabbix and zabbix. Now it can no longer open its log file.
Workaround: Assure that a log file exists with the appropriate owner prior to running zabbix_agentd:
Code:
touch /var/log/zabbix/zabbix_agentd.log chown zabbix:zabbix /var/log/zabbix/zabbix_agentd.log
Comment