help-cfengine
[Top][All Lists]
Advanced

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

copy purge vs. ignore


From: benf
Subject: copy purge vs. ignore
Date: Sat, 27 Jul 2002 14:51:46 -0700

I'm using 2.0.3 on redhat 7.2 and I'm trying to clean up my cfengine config
so that it doesn't keep
purging files and then replacing the deleted files in a subsequent step.

I would like to do:
copy:
        # Sync up cron.daily but ignore
        # foo if it exists
        any::
                /etc/cron.daily
                        dest=/etc/cron.daily
                        action=fix
                        ignore=/etc/cron.daily/foo
                        server=$(cf_server)
                        recurse=inf
                        purge=on

        # copy foo into place if got deleted
        specialhost::
                /etc/cron.daily/Unused/foo
                        dest=/etc/cron.daily/foo
                        action=fix
                        server=$(cf_server)
                        recurse=inf
                        purge=on


What always happens is the the first copy
deletes foo as purge is on, even though it
should ignore it.

Then the second section repairs this problem.
I'm trying to avoid having to do the repair
every time cfengine runs as that just adds
to the chatter in the output. And wastes
valuable computrons!


To test this more, I setup a test system with:
        On the CF server:
                /tmp/test
                /tmp/test/foo-onserver (a file)

        On the client side:
                /tmp/test
                /tmp/test/foo-onclient (a file)



With the following config:
        copy:
                # Stuff done on every run
                any::
                        /tmp/test
                                dest=/tmp/test
                                action=fix
                                ignore=foo-onclient
                                ignore=/tmp/test/foo-onclient
                                server=$(cf_server)
                                recurse=inf
                                purge=on

foo-onserver gets copied like one would expect,
yet foo-onclient gets deleted.
If I put foo-onclient on the server, it then
works better - it will not copy foo-onclient again
and will not purge it either.
Though if the client version disappears it will
copy the file over again.

I tried using includes instead of ignores, but
the behaviour was the same.

So ignore with purge seems to mean copy
everything from the server, but do not
MODIFY ignored files that are on BOTH
the server and the client. Delete anything
on the client not on the server. Copy
all files on the server that are not on
the client, regardless of ignore setting.

Also, purge purges even if the action
is warn! That seems counter-intuitive.

As I'm working on the model of having
entire directies be identical except for
a few different files on the client, this
behavior is non-optimal.

I'm starting to go through the source,
but it'll take some time to come up to speed.
My first pass through PurgeFile makes it look
like it doesn't support the situation where
you want unique files on the client.

Oh yeah, I no longer have the segfault trouble
with the latest version so Mark's fix worked!
I do hate having my own patches on things....

thanks for any help,
benf





reply via email to

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