Hi again,
Brendan Strejcek wrote:
> Set classes based on what kind of file /srv/www is.
>
> http://www.cfengine.org/manuals/cf3-reference.html#Function-islink
> http://www.cfengine.org/manuals/cf3-reference.html#Function-isplain
> http://www.cfengine.org/manuals/cf3-reference.html#Function-isdir
>
> Conditionals should allow you to avoid any race conditions.
>
> Let me know if you need specific examples, or if that is enough to go on.
No matter how I write my test promises, I always end up with the error
message "!! Promise constraint conflicts - /var/www/. cannot be
renamed/moved and exist there at the same time".
*** FIRST EXAMPLE *** - does not work:
<snip>
classes:
SRV_APACHE::
"isdir" expression => isdir("/var/www");
files:
SRV_APACHE.isdir::
"/var/www/."
rename => MoveTo("/srv/www/."),
perms => PermsChgrp("www-data"),
create => "true";
"/var/www"
link_from => LinkFrom("/srv/www"),
perms => PermsChgrp("www-data");
</snip>
*** SECOND EXAMPLE (just to make sure...) *** - same error message:
<snip>
classes:
SRV_APACHE::
"isdir" expression => isdir("/var/www");
"islink" expression => islink("/var/www");
files:
SRV_APACHE.isdir::
"/var/www/."
rename => MoveTo("/srv/www/."),
perms => PermsChgrp("www-data"),
create => "true";
SRV_APACHE.!islink::
"/var/www"
link_from => LinkFrom("/srv/www"),
perms => PermsChgrp("www-data");
</snip>
So the race condition is avoided, but cfengine still complains. Ideas
anyone?
Cheers,
Robert
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine