Hi Rama! Is turning on verbose mode for a couple of runs possible? In body agent control? We might get a clue there.
This email is confidential. If you have received this email in error please notify us immediately by return email and delete this email and any attachments.VIX accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengine+unsubscribe@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
I hesitate to speculate without seeing the code base, but I believe verbose output would help here.
I suspect cfengine will tell you why it's skipping promises - e.g., ifelapsed lock, or inapplicable context.
The bit about agent bundles getting skipped is odd.
Hi Rama! Is turning on verbose mode for a couple of runs possible? In body agent control? We might get a clue there.
Ramakant Duggal P M 0422156849 VIXTECHNOLOGY.COM |
Thank you,. Your promises are getting skipped because contexts they target don't match the current context. In other words, the class you are expecting isn't set.
It's not an issue of the command is not going to be run again because it's been run recently-- I don't see anything in your verbose logs that would indicate that.
Also, cfengine does not cache command output inherently.
I recommend you take a closer look at what's happening with your classes.
If you study the entire verbose log you should be able to trace where classes are and aren't getting set.
Thank you,. Your promises are getting skipped because contexts they target don't match the current context. In other words, the class you are expecting isn't set.
It's not an issue of the command is not going to be run again because it's been run recently-- I don't see anything in your verbose logs that would indicate that.
Also, cfengine does not cache command output inherently.
I recommend you take a closer look at what's happening with your classes.
If you study the entire verbose log you should be able to trace where classes are and aren't getting set.
commands:
any::
"/bin/sed -f $(this.promise_dirname)/nameservers.sed /etc/resolv.conf"
classes => kept_successful_command,
module => "true";
Where "nameservers.sed" contains:
#!/bin/sed -f
1i\
^context=inventory_module
1i\
^meta=inventory,attribute_name=Nameservers
/^nameserver[[:space:]]*/!d
s///
s/[[:space:]]*$//
s/.*/=nameserver[&]=&/
One nice thing about this commands promise is that you can run the script entirely independently of CFEngine to see the module protocol output, which CFEngine will be reading in.
Seeing that long "grep -q" commands promise in your code, I am entirely confident that something similar could be done with your policy (using Sed, or perhaps Awk if really necessary), with an improvement in performance as well as making it easier to reason about the promises correctly.
Best,
--Mike Weilgart
Vertical Sysadmin, Inc.
--
You received this message because you are subscribed to a topic in the Google Groups "help-cfengine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/help-cfengine/qQdZUSFwO6c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to help-cfengine+unsubscribe@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
Hi Mike,Thanks for the useful suggestions in your post. Modules would be the way to for for the reasons you gave.Also I did some read-up on ifelapsed. Setting it to 0 for a promise may not have the side effects that I was worried about. My understanding is that even with ifelapsed set to 0 for a given promise, there will never be 2 agents executing that promise simultaneously due to the promise being locked. I guess the ifelapsed serves to avoid a promise being run repeatedly in quick succession ? That implies there would be a default global value for ifelapsed which would explain the promise being skipped in this case.I couldn't find what the default global value is in online docco. Any ideas ?CheersRama
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengine+unsubscribe@googlegroups.com.
I seem to recall that the default value for ifelapsed is 1 minute.Well done, Rama.I'd love to know how to inspect the locks database. I seem to remember it's on disk.Sorry, I am on the go or else I would provide more detail.