Restarting a service after a configuration file change.

2010-09-26 Thread Simon Oxwell
Hi there, I'm running cfengine 3.0.4 on Solaris 10, and I'm trying to build a promise that will append a line to my sshd_config file and then restart the ssh service, but only when the sshd_config has been updated. So far I've tried this: -- Start code bundle agent authorizedkeyfiles {

Re: Restarting a service after a configuration file change.

2010-09-26 Thread Nicolas Charles
You're code is nearly correct. You just need to set the class if the promise is repaired, not if it's kept. body classes satisfied(new_class) { promise_repaired => { "$(new_class)"}; } Regards, Nicolas On 26/09/2010 21:29, Simon Oxwell wrote: Hi there, I'm running cfengine 3.0.4 on So

RE: Restarting a service after a configuration file change.

2010-09-26 Thread Simon Oxwell
Hi Nicolas, So I should only be setting like this: bundle edit_line append_if_no_line_set_class(str,class) { insert_lines: "$(str)" classes => satisfied($(class)); } body classes satisfied(new_class) { promise_repaired => { "$(new_class)"}; } Not sure if I unde

Re: Restarting a service after a configuration file change.

2010-09-26 Thread Nicolas Charles
You're welcome ! Yes it'll work on both, but you should probably rename it to "repaired", or something like that, to have a name matching the behaviour. And I prefer the first version of the code, where the promise is set as repaired if the whole edit_line is done. Nicolas On 26/09/2010 21