Michael,

while the promise to define restart_class is indeed only checked when
sshd_reconfigured class is defined, you're not quite right defining it
as a problem for this case, since Sandra wrote about if_repaired
problem, not restart_class problem. While agreeing that it isn't
reasonable to check if sshd is still alive only when it's been
reconfigured, I believe the process_select body is the real thing to
inspect first.

Of course, file promise must be repaired indeed to make the process
promise happen, anyway.

2010/11/25 Michael Potter <mega...@gmail.com>:
> 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
>



-- 
SY, Seva Gluschenko.
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to