help-cfengine
[Top][All Lists]
Advanced

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

Re: strange warning


From: Chris Edillon
Subject: Re: strange warning
Date: Wed, 5 Feb 2003 02:25:47 -0400 (GMT+4)

On Tue, 4 Feb 2003, Akop Pogosian wrote:
> On Tue, Feb 04, 2003 at 04:13:11PM -0400, Chris Edillon wrote:
> > On Mon, 3 Feb 2003, Akop Pogosian wrote:
> > 
> > > It works fine. However, when the "initial" class is defined and if
> > > cfengine is running in verbose mode (which happens only when I run
> > > "cfagent -q -v -D initial" from command line), it prints the following
> > > warning at the end:
> > > 
> > > *********************************************************************
> > > Main Tree Sched: editfiles pass 2 @ Mon Feb  3 19:00:56 2003
> > > *********************************************************************
> > > cfengine:zig: Too soon for editfile._var_spool_cron_crontabs_root (0/1
> > > minutes )
> > > 
> >   the default IfElapsed time is 1 minute, and this message indicates
> > that for the particular atomic action cfagent is trying to execute
> > (editing /var/spool/cron/crontabs/root), has already occured within
> > the last minute.  do you happen to be running "cfagent -vq -D initial"
> > just after the normal cfagent run, or after running it by hand without
> > defining "initial"?  that would cause the behavior you're seeing.  try
> > waiting at least a minute after the last cfagent run before trying it
> > from the command line with "-D initial".
> 
> No, I made sure to wait for longer than a minute before running this
> command. That's why this warning surprises me. 
> 
  does /var/spool/cron/crontabs/root happen to exist?  i've been
playing with cfagent and found something interesting.  using the
following cfagent.conf on a linux box:

control:
    actionsequence = ( editfiles )

editfiles:
    any::
    { /tmp/testfile
      AppendIfNoSuchLine "foo"
    }


if the file /tmp/testfile does *not* exist, i get the following
output with cfagent -v:

*********************************************************************
 Main Tree Sched: editfiles pass 1 @ Tue Feb  4 23:41:29 2003
*********************************************************************

cfengine:clea: Couldn't stat /tmp/testfile

cfengine:clea: statcfengine:clea: File was marked for editing
Job start time set to Tue Feb  4 23:41:29 2003


*********************************************************************
 Main Tree Sched: editfiles pass 2 @ Tue Feb  4 23:41:29 2003
*********************************************************************

cfengine:clea: Too soon for editfile._tmp_testfile (0/1 minutes elapsed)



however, if i then create /tmp/testfile as an empty file, it runs
just fine:

*********************************************************************
 Main Tree Sched: editfiles pass 1 @ Tue Feb  4 23:42:39 2003
*********************************************************************

Begin editing /tmp/testfile
Appending [foo]
Appending [bar]
End editing /tmp/testfile
.....................................................................
cfengine:clea: Edited file /tmp/testfile 



so from my testing it appears that the error you've noticed
depends on whether or not the file to be edited actually
exists beforehand.  and incidentally, if i add AutoCreate to
the edit rules, cfagent doesn't generate the error.
  apparently when the "File was marked for editing" the first
time around, it causes it to be edited a second time.  don't
know why though.

chris





reply via email to

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