help-cfengine
[Top][All Lists]
Advanced

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

Re: Copy & hooks?


From: Mark . Burgess
Subject: Re: Copy & hooks?
Date: Mon, 30 Apr 2001 09:09:04 +0200 (MET DST)

On 30 Apr, Tollef Fog Heen wrote:
> 
> (Please Cc me, I'm not a subscriber (yet))
> 
> I am trying to move from rdist to cfengine, and while doing that, I've
> tripped over a problem.  Just copying files are easy.  However, it
> seems like cfengine doesn't support some kind of hooks:
> 
> (${AUTOFILES}) -> (${DEBIANHOSTS})
>         install ;
>         special ${AUTOFILES} "/etc/init.d/autofs restart";
> 
> This is how it is written in the distfile for rdist.  It means that
> 'if ${AUTOFILES} are copied to ${DEBIANHOSTS} then run
> /etc/init.d/autofs restart".
> 
> I don't want to restart my automounter once an hour just because there
> _might_ be new automounter maps.
> 
> Any ideas?  Thanks in advance.
> 


You do it slightly differently in cfengine, by defining a "class"
as a result of the action:

 copy:

   from dest=to define=copied elsedefine=notcopied

 shellcommands:

   copied::

     "/myscript"

   notcopied::

     "/otherscript"



Hope this helps. Check also the manual on AddInstallable and the
actionsequence, to make sure you get the ordering of things
right. (Shellcommands has to come after copy in order for this
to work with cfengine 1 -- it will be better in 2)

best
Mark

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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