Hi, all,
I've encountered a problem on cfengine processes
handling. It is related to the three options
"action=", "match=" and "restart ".
I've monitored sshd processes to fullfill two
purposes:
1, always fires up sshd when it is detected not
running.
2, restart sshd to reload its configuration when the
latter changes, but NOT killing existing ssh
connections.
So, I write the following lines in cfengine
configuration file cf.main:
...
control:
actionsequence = ( ... copy processes shellcommands
...)
AddInstallable = ( new_sshd_config )
...
...
copy:
${master_cfconfigs}/myHosts/etc/ssh/sshd_config-Centos5
dest=/etc/ssh/sshd_config
mode=0400
owner=root
group=root
type=checksum
server=$(policyhost)
define=new_sshd_config
...
...
processes:
linux::
"sshd" matches<1 action=bymatch restart
"/etc/init.d/sshd restart"
linux.new_sshd_config::
"sshd" matches=>1 action=bymatch restart
"/etc/init.d/sshd restart"
...
The first statement in 'processes' section works
great, everytime cfengine fires up sshd when the
latter is not running.
While the second always fails -- I change "=>1" to
"=<1", "<1", ">1" but neither one work. I turns on the
debugging option, new_sshd_config is set since I
inentionally alters the sshd_config file every time I
run cfagent, But cfengine just refused to run.
I've looked up the cfengine reference doc and it
looks confusing -- English is not my first language :)
Especially the 'match=', 'action=bymatch' and
'restart' statement:
1, Does 'match' statement always have a '='
immediately follow it? In my working configuration it
is NO.
2, what the 'action=bymatch' means? Does It mean to
carry out operations when the matching criteria is
TRUE? or reverse? From the above working configuration
it looks like the first guess, but from reference it
says a different story. -- ( Reference: If the option
is set to bymatch, then signals are only sent to the
processes if the matches criteria fail. )
3, can the 'restart' statement be set without
'signal=' options?
Any clarification is greatly appreciated. Thanks.
--Guolin
____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine