Forum: Cfengine Help
Subject: Re: process miscounting?
Author: matter
Link to topic: https://cfengine.com/forum/read.php?3,16494,16632#msg-16632

I was wrong in my case of process miscounting. I did a little code modification 
as adding "ps -ef" command after the process count has been complete did not 
catch the problem. I modified the regex matching function to spit out what it 
was matching and I happened to catch what I thought was a bug:

# ./cf-agent -Kf /var/cfengine/cluster/test.cf

regexp:clcomd
teststring:    root  27630  12140   5   Feb 18      - 475:29 
/usr/es/sbin/cluster/clcomd -d 

regexp:clcomd
teststring:    root  56176  27630   0 09:41:30      -  0:00 
/usr/es/sbin/cluster/clcomd -d 

 !! Process count for 'clcomd' was out of promised range (2 found)

So cfengine did what I told it to do. It was me who was in error. I had no idea 
that this process would spawn another from itself (see the pid group number). 
It happens a couple of times a day, and cfengine must have hit it right at the 
time of the spawning, even though it was a running for only a second.  Looking 
in the logs for that process, it does indeed have activity at 09:41:30, so it 
must spawn another process for remote connections.

It would appear cfengine knows more about this process than I did. Sorry for 
the false alarm. I am humbled.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to