My CFEngine 3 execution shows multiple double file permission changes like this:

info: Object '/etc/prosody/prosody.cfg.lua' had permission 0600, changed it to 0644
info: Object '/etc/prosody/prosody.cfg.lua' had permission 0644, changed it to 0600

The corresponding configuration is this:

    copy_from => copyfrom_sync("$(sys.inputdir)/files/prosody.cfg.lua"),
    classes => if_repaired(prosody_config_changed),
    perms => mog("600", "prosody", "prosody");

The problem is that the permission change back and forth triggers some script execution unnecessarily. Why does it change the permission to 0644 at all?

I can fix the issue by using local_dcp instead of copyfrom_sync, but I would like to understand why this happens. 0644 is not the permission of the source file. It also does not happen for all files I use copyfrom_sync for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.