I have seen a bug with the right of log for zabbix_agentd : Indeed, if the log file don't exist, he is created with root as owner, and zabbix can't write in it.
This is a patch who move the first "touch" of the lof file after fork in user zabbix is done :
This is a patch who move the first "touch" of the lof file after fork in user zabbix is done :
Code:
diff -ru zabbix-1.1-orig/src/zabbix_agent/zabbix_agentd.c zabbix-1.1/src/zabbix_agent/zabbix_agentd.c
--- zabbix-1.1-orig/src/zabbix_agent/zabbix_agentd.c 2006-06-08 15:21:33.000000000 +0200
+++ zabbix-1.1/src/zabbix_agent/zabbix_agentd.c 2006-06-08 15:26:37.000000000 +0200
@@ -204,6 +204,12 @@
}
+ if(CONFIG_LOG_FILE == NULL)
+ zabbix_open_log(LOG_TYPE_SYSLOG,CONFIG_LOG_LEVEL,NULL);
+ else
+ zabbix_open_log(LOG_TYPE_FILE,CONFIG_LOG_LEVEL,CONFIG_LOG_FILE);
+
+
if( (pid = fork()) != 0 )
{
exit( 0 );
@@ -543,11 +549,6 @@
init_metrics();
init_config();
- if(CONFIG_LOG_FILE == NULL)
- zabbix_open_log(LOG_TYPE_SYSLOG,CONFIG_LOG_LEVEL,NULL);
- else
- zabbix_open_log(LOG_TYPE_FILE,CONFIG_LOG_LEVEL,CONFIG_LOG_FILE);
-
load_user_parameters();
switch(task)


Comment