help-cfengine
[Top][All Lists]
Advanced

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

cfexecd runlog bug


From: Jason Kim
Subject: cfexecd runlog bug
Date: Wed, 4 May 2005 20:22:39 -0400
User-agent: KMail/1.7.2

I know this is the wrong place to send this, but I seem to be having trouble 
getting to the bug list and/or archives, hoping someone who knows something 
can forward this on to the right people...

I'm new to cfengine, but I noticed that when running cfexecd in daemon mode 
I'd get 2 runlog files: 'cfengine.<hostname>.runlog' and 'cfengine..runlog'. 
A quick google search indicates this is a bug of some sort, but I never saw a 
resolution. I've just poked around in the code (damn does my head hurt), I 
think I've found the problem. If this is old news, I apologize.

In the cfexecd source (cfexecd.c) in the 'CheckOptsAndInit' function, a call 
is made to 'GetNameInfo', which seems to (among other things) set 'VUQNAME' 
to NUL and populate 'VSYSNAME'. Then, in 'CheckOptsAndInit', 'VUQNAME' is set 
to 'VSYSNAME.nodename'.

Now if I'm understanding correctly, 'VUQNAME' is used as the hostname in the 
'StartServer' function for getting locks (and therefore also setting the 
runlog filename), which works for the initial 'cfexecd' lock. However, before 
the lock is gotten for 'cfd', a call is made to 'ScheduleRun', which in turn 
calls 'GetNameInfo', which sets 'VUQNAME' to NUL. Then the lock for 'cfd' is 
gotten with an empty 'VUQNAME'.

I've attached a trivial patch that resets 'VUQNAME' whenever 'GetNameInfo' is 
called. Seems to fix the problem for me.
-JayKim

Attachment: cfexecd.patch
Description: Text Data


reply via email to

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