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
--- cfexecd.c.orig	2005-05-04 19:54:34.000000000 -0400
+++ cfexecd.c	2005-05-04 19:55:02.000000000 -0400
@@ -555,6 +555,7 @@
       DeleteItemList(VHEAP);
       VHEAP = NULL;
       GetNameInfo();
+      strcpy(VUQNAME,VSYSNAME.nodename);
       return true;
       }
    }
@@ -562,6 +563,7 @@
 DeleteItemList(VHEAP);
 VHEAP = NULL; 
 GetNameInfo();
+strcpy(VUQNAME,VSYSNAME.nodename);
 return false;
 }
 
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine

Reply via email to