hello list,

i am doing some testing with cfengine3 and i am having trouble figuring 
out how to do conditional command execution. the specific example i am 
trying to get working is as follows:

- the client copies in /etc/ssh/sshd_config from the server

files:

     "/etc/ssh/sshd_config"
         perms => mog("644", "root", "wheel"),
         copy_from => 
secure_cp("$(g.masterfiles)/config/etc/ssh/sshd_config", "$(g.phost)");

- if the existing /etc/ssh/sshd_config on the client is up-to-date, do 
nothing, but if it had to be modified then issue 'pkill -HUP sshd' on 
the client so that sshd re-reads its config file

since issuing 'pkill -HUP sshd' will close all existing ssh sessions i 
would rather not run the command unless it is required i.e. 
/etc/ssh/sshd_config has changed. i have verified that the copying of 
sshd_config works fine sans the conditional command.

having looked through the documentation i don't see an elegant way to do 
what i describe above. i would appreciate a tip on how to effect this 
and/or a pointer to where i could have found this in the docs.

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

Reply via email to