On Thu, Nov 25, 2010 at 7:05 AM, Sandra Wittenbrock <san...@hpcrd.lbl.gov> wrote: > Hello, > > I am trying to use if_repaired(x). > > I have it defined as follows in library.cf: > > body classes if_repaired(x) { > promise_repaired => { "$(x)" }; > } > > I'm using the following in an attempt to restart sshd when the > configuration is changed by cfengine. Unfortunately, I'm not able to > get it to detect any changes have been made. I use the umycopy > elsewhere in the same way, and don't see any problems. > > Any help would be appreciated. > > files: > > "/etc/ssh/sshd_config" > perms => usystem("0744"), > copy_from => > umycopy("/var/lib/cfengine3/masterfiles/conf/sshd_config"), > classes => if_repaired("sshd_reconfigured"); > > processes: > > any:: > sshd_reconfigured:: > "sshd" > signals => { "hup" }, > process_select => listening_sshd, > restart_class => "restart_sshd";
The above promise is problematic. You have a process promise to check if ssh is running (and define restart sshd if it is not) - but this check only occurs if ssh_reconfigured is defined. You should break it into two promises - one to check and set restart_class, another to send the signal if the sshd_config has been changed. This may be why it didnt work - it may also have something to do with your process_select body - you should show that aswell. > > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine > _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine