tags 376681 + patch
thanks

hi again,

On Tue, Jul 04, 2006 at 02:16:51PM +0200, Michael Ablassmeier wrote:
> On Tue, Jul 04, 2006 at 10:37:56AM +0200, Robert Millan [ackstorm] wrote:
> > zabbix-agent should cleanup /tmp/zabbix_agentd.tmp in init.d.  When run 
> > with an
> > obsolete version of this file, the daemon won't generate a new one, making
> > debugging tasks tedious (specialy if you ignore this fact).
> > 
> > Besides, it doesn't remove it when it's no longer in use either.
> 
> thats true, im going to have a look at the agent souce, IMHO this file
> should be removed by the daemon itself.

said that, see attached patch. Forwading to upstream's forum.

bye,
    - michael
--- /home/abi/zabbix-1.1/src/zabbix_agent/zabbix_agentd.c       2006-05-29 
14:19:49.000000000 +0200
+++ zabbix_agentd.c     2006-07-04 14:30:29.000000000 +0200
@@ -106,6 +106,7 @@
 char   *CONFIG_HOSTNAME                = NULL;
 char   *CONFIG_FILE                    = NULL;
 char   *CONFIG_PID_FILE                = NULL;
+char   *CONFIG_STAT_FILE               = NULL;
 char   *CONFIG_LOG_FILE                = NULL;
 int    CONFIG_AGENTD_FORKS             = AGENTD_FORKS;
 /*int  CONFIG_NOTIMEWAIT               = 0;*/
@@ -134,6 +135,11 @@
                        }
                }
 
+               if( unlink(CONFIG_STAT_FILE) != 0) {
+                       zabbix_log( LOG_LEVEL_WARNING, "Cannot remove STAT file 
[%s]",
+                               CONFIG_STAT_FILE);
+               }
+
                if( unlink(CONFIG_PID_FILE) != 0)
                {
                        zabbix_log( LOG_LEVEL_WARNING, "Cannot remove PID file 
[%s]",
@@ -265,7 +271,7 @@
                {"Hostname",&CONFIG_HOSTNAME,0,TYPE_STRING,PARM_OPT,0,0},
                {"PidFile",&CONFIG_PID_FILE,0,TYPE_STRING,PARM_OPT,0,0},
                {"LogFile",&CONFIG_LOG_FILE,0,TYPE_STRING,PARM_OPT,0,0},
-/*             {"StatFile",&CONFIG_STAT_FILE,0,TYPE_STRING,PARM_OPT,0,0},*/
+               {"StatFile",&CONFIG_STAT_FILE,0,TYPE_STRING,PARM_OPT,0,0},
                
{"DisableActive",&CONFIG_DISABLE_ACTIVE,0,TYPE_INT,PARM_OPT,0,1},
                
{"EnableRemoteCommands",&CONFIG_ENABLE_REMOTE_COMMANDS,0,TYPE_INT,PARM_OPT,0,1},
                {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30},
@@ -312,10 +318,10 @@
                }
        }
 
-/*     if(CONFIG_STAT_FILE == NULL)
+       if(CONFIG_STAT_FILE == NULL)
        {
                CONFIG_STAT_FILE=strdup("/tmp/zabbix_agentd.tmp");
-       }*/
+       }
 }
 
 void    load_user_parameters(void)

Reply via email to