Forum: Cfengine Help
Subject: Re: Too many cf-execd processes running
Author: daveseff
Link to topic: https://cfengine.com/forum/read.php?3,17902,17927#msg-17927
Ok. I have tried to whittle this down to one file. Easier said than done. I've
also set my schedule to every 5 min so I don't have to sit around all day. I
have removed all of my customizations. I'm now having trouble getting the
machines to communicate at all.
# cf-promises -x
----------------------------------------------------------
Cfengine - Level 1 self-diagnostic
----------------------------------------------------------
-> editfilesize ok (10000/10000)
-> editbinaryfilesize ok (100000/100000)
-> sensiblesize ok (1000/1000)
-> sensiblecount ok (2/2)
-> Internal consistency done
----------------------------------------------------------
Cfengine - Level 2 self-diagnostic
----------------------------------------------------------
1. Test variable scanning
2. Testing internal function templates and knowledge
3. Testing promise duplication and expansion
4. Testing variable expansion
5. Testing regular expression engine
-> Regex engine is the Perl Compatible Regular Expression library
-> Regular expression compilation - ok
-> Regular expression extraction - ok 15 - 31
-> Regular expression extraction - ok
-> FullTextMatch - ok 2
-> BlockTextMatch - ok
-> BlockTextMatch - ok
6. Testing promise attribute completeness (with no desired intention)
!! files promise makes no intention about system state
I: Promise is made internally by cfengine
I: Comment:
-> All non-listed items are accounted for
Here is cf-execd -v:
cf3 Interface 1: lo
cf3 Interface 2: eth0
cf3 Adding alias vsin0vl157..
cf3 Trying to locate my IPv6 address
cf3 Looking for environment from cf-monitor...
cf3 Unable to detect environment from cfMonitord
cf3 This appears to be a redhat system.
cf3 Looking for redhat linux info in "Red Hat Enterprise Linux Server release
5.3 (Tikanga)
"
cf3 Reference time set to Mon Aug 16 13:45:08 2010
cf3 Checking schedule Min00...
cf3 Checking schedule Min05...
cf3 Checking schedule Min10...
cf3 Checking schedule Min15...
cf3 Checking schedule Min20...
cf3 Checking schedule Min25...
cf3 Checking schedule Min30...
cf3 Checking schedule Min35...
cf3 Checking schedule Min40...
cf3 Checking schedule Min45...
cf3 Waking up the agent at Mon Aug 16 13:45:07 2010
~ Min45
cf3 Sleeping for splaytime 56 seconds
cf3 Sleeping...
cf3 ------------------------------------------------------------------
cf3 LocalExec(scheduled) at Mon Aug 16 13:46:04 2010
cf3 ------------------------------------------------------------------
cf3 -> Command => "/var/cfengine3/bin/cf-agent" -f failsafe.cf &&
"/var/cfengine3/bin/cf-agent" -Dfrom_cfexecd:scheduled_run
cf3 -> Command is executing..."/var/cfengine3/bin/cf-agent" -f failsafe.cf &&
"/var/cfengine3/bin/cf-agent" -Dfrom_cfexecd:scheduled_run
cf3 -> Command is complete
cf3 -> Mailing result
cf3 Mail result...
cf3 Comparing files /var/cfengine3/outputs/previous with
/var/cfengine3/outputs/cf_vsin0vl157_svr_us_jpmchase_net__1281980764_Mon_Aug_16_13_46_04_2010__40b1c940
cf3 Previous output is the same as current so do not mail it
But the server just shows this:
cf3 -> Waiting at incoming select...
cf3 -> No new promises found
cf3 -> Waiting at incoming select...
cf3 -> No new promises found
cf3 -> Waiting at incoming select...
cf3 -> No new promises found
cf3 -> Waiting at incoming select...
cf3 -> No new promises found
cf3 -> Waiting at incoming select...
cf3 -> No new promises found
repeats.......
Here is my config::
#######################
# promises.cf
#######################
body common control {
bundlesequence => {
"update",
"executor",
"server",
"cfbackup" # should be last
};
inputs => {
"update.cf",
"cfengine_stdlib.cf",
"library.cf",
"cf-serverd.cf",
"cf-execd.cf",
"cfbackup.cf"
};
}
bundle common g{
vars:
"repo" string => "/var/cfengine3/master";
"inputs" string => "/var/cfengine3/inputs";
"binaries" string => "/var/cfengine3/sbin";
"libraries" string => "/var/cfengine3/lib";
"workdir" string => "/var/cfengine3";
# for HA add more policy hosts
"phost" string => "10.0.0.1";
}
body agent control {
# Do not rely on DNS
skipidentify => "true";
editfilesize => "5000000";
}
#######################
# CF Server
#######################
body server control {
# Do not use DNS
skipverify => { "10\.*\.*\.*" };
allowconnects => { "10.0.0.0/8" , "127.0.0.1" };
allowallconnects => { "10.0.0.0/8" , "127.0.0.1" };
maxconnections => "50";
logallconnections => "true";
trustkeysfrom => { "10.0.0.1" , "127.0.0.1" };
bindtointerface => "0.0.0.0";
cfruncommand => "${g.workdir}/bin/cf-agent ||
/var/cfengine3/failsafe/bin/cf-failsafe.sh";
allowusers => { "root" };
}
# ensure server is running.
bundle agent server {
processes:
"cf-serverd"
restart_class => "start_cfserverd";
commands:
start_cfserverd.MASTER_SERVER::
"${g.workdir}/bin/cf-serverd";
}
bundle server access_rules {
vars:
"allow_hosts" slist => { readstringlist(
"/var/cfengine3/inputs/hosts.allow", "#.*", "[\n]", 1000, 1000000 ) };
access:
"${g.repo}"
admit => { $(allow_hosts) };
"${g.inputs}"
admit => { $(allow_hosts) };
"${g.binaries}"
admit => { $(allow_hosts) };
"${g.workdir}/bin/cf-agent" admit => {
"${g.phost}" };
}
body runagent control {
hosts => { "10.0.0.1" };
}
########
# Library.cf
#######
# Library of commond code
body edit_defaults std_defs_with_backup {
empty_file_before_editing => "false";
edit_backup => "true";
max_file_size => "5000000";
}
body copy_from mycopy(from,server) {
source => "${from}";
servers => { "${server}" };
compare => "digest";
}
body copy_from syncopy(from,server) {
source => "${from}";
servers => { "${server}" };
compare => "digest";
verify => "true";
purge => "true";
}
body edit_defaults backup_and_empty_before_edit {
edit_backup => "true";
empty_file_before_editing => "true";
max_file_size => "5000000";
}
body edit_defaults edit_large_files {
max_file_size => "5000000";
}
#########
# Failsafe.cf
##########
body common control {
bundlesequence => { "update" };
inputs => { "update.cf" };
}
############################################
body depth_search recurse(d) {
depth => "$(d)";
}
#######################
# update.cf
#######################
bundle agent update {
vars:
"repo" string => "/var/cfengine3/master";
"inputs" string => "/var/cfengine3/inputs";
"binaries" string => "/var/cfengine3/sbin";
"scripts" string => "${repo}/scripts";
# for HA add more policy hosts
"phost" string => "10.0.0.1";
files:
# Fix directories
"/var/cfengine3/."
create => "true",
perms => usystem("0700");
"/var/cfengine3/bin/."
create => "true",
perms => usystem("0700");
"/var/cfengine3/ppkeys/."
perms => usystem("0700");
# Copy inputs
"/var/cfengine3/inputs"
perms => usystem("0600"),
copy_from => umycopy("${inputs}"),
depth_search => urecurse("inf");
# Check/copy CFengine binaries
"/var/cfengine3/sbin"
perms => usystem("0755"),
copy_from => umycopy("${binaries}"),
depth_search => urecurse("inf");
# Copy scripts
"${repo}/scripts"
perms => usystem("0600"),
copy_from => umycopy("${scripts}"),
depth_search => urecurse("inf");
# Copy binaries
"/var/cfengine3/bin/cf-failsafe.sh"
perms => usystem("0700"),
copy_from =>
umycopy("$(scripts)/cf-failsafe.sh");
}
body depth_search urecurse(d) {
depth => "${d}";
exclude_dirs => { "\.X11", ".*kde.*", "\.svn", ".*\.swp$" };
}
body perms usystem(p) {
mode => "${p}";
owners => { "root" };
groups => { "root" };
}
body copy_from umycopy(from) {
source => "${from}";
servers => { "${phost}" };
compare => "digest";
verify => "true";
purge => "true";
}
#######################
# cf-execd.cf
#######################
body executor control {
splaytime => "0";
schedule => { "Min00", "Min05", "Min10", "Min15", "Min20", "Min25",
"Min30", "Min35", "Min40", "Min45", "Min50", "Min55" };
executorfacility => "LOG_DAEMON";
}
bundle agent executor {
processes:
"cf-execd"
restart_class => "start_cfexecd";
commands:
start_cfexecd::
"${g.workdir}/bin/cf-execd";
reports:
start_cfexecd::
"cf-execd process not found";
}
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine