help-cfengine
[Top][All Lists]
Advanced

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

Re: files create and fix action question


From: Mark Burgess
Subject: Re: files create and fix action question
Date: Fri, 04 Nov 2005 21:20:05 +0100

Are you sure that action=create alone doesn't do what you want?

M

On Fri, 2005-11-04 at 11:23 -0600, Frank Smith wrote:
> I'm trying to make a files action that will create a file if it
> doesn't exist or will fix ownership if it does exist but is wrong.
> 
> action=create can do the first
> action=fixplain can do the second
> 
> However, if I use both a create and fixplain action, only the first
> one in the config actually does anything, cfengine's file locking
> prevents the second one from running.  So if the create action is
> first, it will create it if not there but will not fix it if it is.
> Conversely, if the fixplain is first it will fix ownerships if it is
> wrong, but it will never create the file if it isn't there (the fix
> action sets a lock even if the file to fix doesn't exist, so a create
> won't happen because the non-existant file is locked).
> 
> action=touch will do what I want, except that it changes the timestamp
> of the file on every run whether it changes anything or not (which is
> what I would expect a touch to do, but not what I want)
> 
> Is there some option I've missed that could achieve both a create and
> a fix and do whichever one is needed?
> 
> Thanks,
> Frank
> 





reply via email to

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