[Top][All Lists]

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

Re: Cfservd not rereading config... (fix?)

From: Christian Pearce
Subject: Re: Cfservd not rereading config... (fix?)
Date: Wed, 20 Apr 2005 12:03:51 -0400

Okay I have patch with a few caveats.

1. I moved the check for ACTIVE_THREADS to CheckFileChanges.  Makes the
code cleaner.  And I make more that just one call to it.
2. I added CheckFileChanges to the SIGHUP signal and to right after
accept in StartServer.
3. I actually use import in cfservd.conf.  Problem is VIMPORT doesn't
get NULLed when reloading.  So it just keeps adding to the list.
Eventually this will bomb out.  This is done in CheckFileChanges.


1. I assume the reason you check for active threads in StartServer
before you reload the config is to prevent unknown state of the config
when a server from connecting or one that is already connection.  Should
the CheckFileChanges then block new threads from being added?  I am not
an expert but I don't see this.

2.When the cfservd.conf gets reloaded it warns that about macro
redefinition.  I don't know if this is okay or not.  But I don't know if
you can just clear the has before you reload.  (ie is the hash used

On Wed, 2005-04-20 at 11:23 -0400, Christian Pearce wrote:
> I know I have chirped about this before. I am pawing through the code. I
> added some debugs. Essentially in StartServer (cfservd.c) there is a
> while loop. At the top of it it checks the file but only if there are no
> active threads. Unfortunately this code never gets called till after the
> connection is made and a thread is active.
> I added a debug to spit out the number of active threads.  It is 0 when
> I start.  A connection is made.  The treads go back down to zero in
> HandleConnection.  But at this point my original debug about
> CheckFileChanges never gets executed until after a new connection is
> made and the threads increase to 1.  So the code never gets reread.
> Except very random times through out the day.  I suppose it is doing
> something with threads I just don't understand.
> Clearly this isn't working like it should.
> Mark do you have thoughts on this.  It gets quite difficult to explain
> the code in email.
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-cfengine
Christian Pearce

Attachment: cfservd.c.patch-hup+import+reread
Description: Text document

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

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