help-cfengine
[Top][All Lists]
Advanced

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

Re: action sequence ;)


From: Phil D'Amore
Subject: Re: action sequence ;)
Date: Fri, 16 Jan 2004 11:26:30 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

From looking at the output, the following:

cf:cfengine::./update.conf:56: DNS lookup failure. Unknown host
is a parse-time error, not a runtime error.  Because it is a parse error, it is 
likely that the actionsequence is not being run, therefore resolv.conf is not 
updated at all.

The parse error is in the copy.  Ignore the fact that the line number points to 
the start of the tidy operation.  Cfengine's parser is your basic lex/yacc 
based parser, and with these sometimes, the line number is a bit off.  What you 
are seeing here, is that the parser reads the copy stanza, incrementing the 
line number as it goes.  It doesn't actually digest the content of that stanza 
until it sees the *next* thing that comes along.  By that time, the line number 
is pointing to the next thing, in this cast the tidy: line.  The error is in 
the copy, which is why removing it in your second example causes the 
resolv.conf to be fixed.  No more parse error, so the actionsequence actually 
runs :).


Something you also need to be aware of is the way the resolv.conf is read by the resolver routines. Resolv.conf reading is not dynamic. When cfagent starts and the C library does its initialization mojo, it initializes the name resolver (via NSS or whatever the facility on your OS). At this point, /etc/resolv.conf is read and that is it. If it is wrong at the time the program loads, it's wrong for the duration of the program, even if the program fixes it. Even cf.preconf fixes it, it may not help you, since cfagent is already running. Your only real solution to a broken resolv.conf is probably /etc/hosts, as previously suggested, or (maybe less desireable), using an IP for your policyhost *may* help you here.

Hope this explains the mechanics of what you are seeing.

Later,

--

Phil D'Amore                             "Sometimes there is a fine line
Senior System Administrator               between criminally abusive
Red Hat, Inc                              behavior and fun."
Office: 919.754.3700 x44395                 -- Ted the Generic Guy
Pager: 877.383.8795                            (Dilbert 4/19/2003)






reply via email to

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