help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: define based on multiple copies


From: Daniel Pittman
Subject: Re: define based on multiple copies
Date: Wed, 19 Nov 2003 12:59:34 +1100
User-agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.5 (celeriac, linux)

On Tue, 18 Nov 2003, Kurt Lieber wrote:
> I have a series of configuration files that need to be copied from our
> master server to each client. Then, these files are assembled on the
> client machine and installed into the correct location. (this is an
> /etc file for a particular service)
> 
> If any one file changes, I want to bounce that service. However, if
> two or more files change, I don't want to bounce the service each
> time. Right now, I have something similar to:
> 
> copy: 
> 
>       $(master)/conf.default  dest=/tmp/conf.default
>                               define=bounce_service
>                                                       type=checksum
> 
>       $(master)/conf.special  dest=/tmp/conf.special
>                               define=bounce_service
>                                                       type=checksum
> 
> Then I use bounce_service in shellcommands: to assemble the two files
> and dump them into /etc/. As you can see, that will restart the
> service twice, which is undesirable.

I don't think you quite understand how the cfengine 'actionsequence'
process works.

Unless you add the 'shellcommands' action to it twice, it only gets run
once.

Likewise, no matter how many times you define a state, it only gets
defined to 'true' "once", as it were.

Try watching the output of 'cfagent -v' with your script and you should
see that it only performs your action as requested.


If you are trying to use the same action (shellcommands, for example) in
more than one configuration file, that could be causing your problem.

Look in the tutorial and reference manual for the 'temporary
definitions' with each action item.

             Daniel

-- 
We should forget about small efficiencies, say about 97% of the time:
premature optimization is the root of all evil.
        -- Donald E. Knuth, _Structured Programming with go to Statements_
           (Computing Surveys, Vol. 6, No. 4, December 1974)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]