Forum: Cfengine Help
Subject: Re: Set class on file changes
Author: Ferjama
Link to topic: https://cfengine.com/forum/read.php?3,19601,19655#msg-19655

Hi,

I’ve god a similar problem and tried the mentioned solution with "action" but 
it didn't helped. I want to restart a daemon if the configuration changed. Here 
is my old solution from cfe2:

copy:
        $(masterfiles)/global/etc/ntp.conf      dest=/etc/ntp.conf rec=inf 
type=checksum server=$(cfe_server) define=ntpRestart

shellcommands:
        ntpRestart::
                "/etc/init.d/ntp restart"

But how does it have so look in cfe3? Dies doesn't work:

bundle agent ntp {
 files:
  Hr05.Min40_45::
    "/etc/ntp.conf"
        copy_from       => 
remote_cp("$(g.cfe_server)","$(g.masterfiles)/global/etc/ntp.conf"),
       action          => "if_ntp_update";
}
body action if_ntp_update {
commands:
    SuSE::
       "/etc/init.d/ntp restart";
           
    !SuSE::
       "/etc/init.d/ntpd restart";
}


I hope somebody can help.

Best regards
 Stephan

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

Reply via email to