I did some furher tests, making the initially over 1000-line
cfagent.conf into a very minimal one which demonstrates the behaviour.
It turns out that the printing of the particular message depends on
what is the last action in the cfagent.conf file. The messages seem to
appear if the last action is editfiles.

Here is the code to reproduce the bug:

Script started on Thu Apr 12 16:34:44 2007
xan14# cat /tmp/cfagent.conf.bug
control:

    actionsequence = (
         directories
    )

control:
    Inform = ( on )

directories:

editfiles:

xan14# cfagent -f /tmp/cfagent.conf.bug
cfengine:xan14: Prepending [xan14]
cfengine:xan14: Appending [xan14]
xan14# cat /tmp/cfagent.conf.nobug
control:

    actionsequence = (
         directories
    )

control:
    Inform = ( on )

editfiles:

directories:

xan14# cfagent -f /tmp/cfagent.conf.nobug
xan14# 
exit

Script done on Thu Apr 12 16:35:42 2007


As can be seen, the difference is only in the ordering of "editfiles"
and "direcotries" sections in the file. In the real cfagent.conf,
there are close to 1000 lines of code between the Inform = ( on ) and
the final two sections. The sections are non-empty as well. But all
this does not matter. What seems to matter is what is the final action
defined in the input file. When it is "editfiles", two unnesecessay
messages are printed. If it is anything else, these messages are not
printed. These messages are irrelevant to the actions actually
performed (the example does not perform any useful action, yet the
messages are printed).

I would call such behaviour buggy. 

Toomas Tamm


On Thu, Apr 12, 2007 at 11:16:55AM +0200, Mark Burgess wrote:
> Toomas Tamm wrote:
> > With Debian releasing the etch (4.0) release, my cfengine was upgraded
> > to 2.1.20 . I have Inform = ( on ) in my cfagent.conf and cfengine is
> > run regularly from cron.
> >
> > It used to be the case that if no changes were made to the system, a
> > run on "cfagent" produced no output even with Inform = ( on ) . This
> > is an useful sign that things are unchanged and the script need not
> > produce a log.
> >
> > Since the upgrade, cfagent is always producing two lines of output:
> > cfengine:hostname: Prepending [hostname]
> > cfengine:hostname: Appending [hostname]
> > (where hostname is the actual host name where the program is running)
> > even when no changes are made to the system.
> >
> > I looked at the source of version 2.1.22 from cfengine.org and I guess
> > the messages are produced by cfagent.c line 1084 and following, where
> > the program is massaging the binserver list. There seems to be no
> > apparent way to suppress this output as long as Inform = ( on ) is
> > set.
> >
> > Obviously, this can be worked around by grep-ing the output, but I
> > find this a non-elegant solution. The behaviour since I started to use
> > cfengine around year 2000 has been that Inform = ( on ) produces no
> > output if the system is unchanged. It would be nice if this tradition
> > were continued.
> >
> > Since the binservers feature does not appear to be a frequently used
> > one (IMHO), I suggest that these messages (perhaps the whole
> > processing of binservers list) should be suppressed if the user does
> > not intend to use the particular feature.
> >
> >   
> 
> Set inform = off in the edit stanza? I think this is not really a bug.
> It is simply a question about
> how these different messages are classified. If you don' like them you
> are also free to
> remove that message from the code. Or reclassify it
> 
> M

-- 
Toomas Tamm                                 e-mail: tamm (at) yki.ttu.ee
Chair of Inorganic Chemistry                voice:  INT+372-620-2810
Tallinn University of Technology            fax:    INT+372-620-2828
Ehitajate tee 5, EE-19086 Tallinn, Estonia  http://www.kk.ttu.ee/toomas/
_______________________________________________
Bug-cfengine mailing list
[EMAIL PROTECTED]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to