bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in methods (cfengine 2.1.7p1)


From: Sven Mueller
Subject: Re: Bug in methods (cfengine 2.1.7p1)
Date: Thu, 05 Aug 2004 14:46:27 +0200
User-agent: Thunderbird 0.6 (Windows/20040502)

Sven Mueller [u] wrote on 05/08/2004 13:04:

> Why does cfagent (when called for) InstallNagiosCheck remove a file which isn't even intended for it? In fact, the cfagent child process for InstallNagiosCheck purges just the file about which the later child process for InstallLeososPackage complains it can't find.
>
> Any hints? Is this fixed in cfengine 2.1.8? The Chnagelog entry
>     Bugs in implementation of remote method protocol. Classes were
>           not transferred properly.
> gives a hint it might be.
>
> Would appreciate any help.


OK, I tracked it down a bit. The part of methods.c which actually deletes the file we need later on is line 1052 ff.:

if (statbuf.st_mtime > (CFSTARTTIME - 2*3600)) /* Default 2 hr expiry */
         {
         Debug("Purging expired method (3) %s\n",path);
         unlink(path);
         continue;
         }

It seems to me that the ">" should actually be a "<". Otherwise you delete any file which is has last been modified _since_ (not before) CFSTARTTIME - 2hrs.
I assume the same is true for the similar comparisons in lines:
line  124: if (statbuf.st_mtime > CFSTARTTIME + (VEXPIREAFTER * 60))
line 1043: if (statbuf.st_mtime > (CFSTARTTIME - (mp->expireafter * 60)))
line 1052: if (statbuf.st_mtime > (CFSTARTTIME - 2*3600)) /* Default 2 hr expiry */


cu,
sven




reply via email to

[Prev in Thread] Current Thread [Next in Thread]