After some offlist discussion, and testing with a more recent version
of cfengine (2.1.20), I'll eat the comment below. 'action=create' in
a 'files:' action will now both create files (or directories), AND
continue to check/fix modes (though it may take two runs of cfengine
to get the modes right on new directories). Atom notes that it does
NOT check/fix modes recursively though.
-Ed
Ed Brown wrote:
This has come up a few times in the past, it's really a surprising and
disappointing missing capability. I don't think you CAN both create a
file if it's missing and fix permissions on an existing file, with one
'files:' statement. A suggested workaround is two files actions, with
'ifelapsed=0' to avoid locking issues.
-Ed
Atom Powers wrote:
I am trying to write a rule that creates a file, directory if it
doesn't exist, and enfoce ACLs on it if it does. I am trying to use:
--
/var/log/service.log
mode=640 owner=service group=wheel
action=create
action=fixall
--
But this doesn't work, it failes because it's trying to fix a file
that doesn't exist.
--
cfengine:host: Cannot access file/directory /var/log/service.log
cfengine:host: File/Dir /var/log/service.log did not exist and was
marked (fixall)
--
What is the correct way to do this?
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
http://cfengine.org/mailman/listinfo/help-cfengine