Skip to content

CFE-3275: Documented where report_diffs stores its cached copies - #3764

Open
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-3275/master
Open

nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-3275/master

Conversation

@nickanderson

Copy link
Copy Markdown
Member

Documents the $(sys.statedir)/change_details location that report_diffs cached copies moved to in CFE-3275.

@nickanderson
nickanderson marked this pull request as draft September 3, 2026 17:37
@cf-bottom

Copy link
Copy Markdown

Thanks for submitting a pull request! Maybe @craigcomstock can review this?

@nickanderson
nickanderson marked this pull request as ready for review September 5, 2026 00:12

@craigcomstock craigcomstock left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questions

`$(sys.statedir)/change_details` that mirrors the path of the monitored file,
so the copy of `/etc/ssh/sshd_config` is
`/var/cfengine/state/change_details/etc/ssh/sshd_config`. The location is not
configurable, and `repository` does not change it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is repository here? is that a variable somewhere? Do you mean that https://docs.cfengine.com/docs/lts/reference/components/cf-agent/#default_repository does not do what it says and change the default repository location from /var/cfengine/state/change_details to whatever is specified?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curiously the docs say the file is underscored instead of directories created in the repository

Notes: When a repository is specified, the files are stored using the canonified directory name of the original file, concatenated with the name of the file. So, for example, /usr/local/etc/postfix.conf would ordinarily be stored in an alternative repository as _usr_local_etc_postfix.conf.cfsaved. If unset then backups are stored in the same directory as the original file with an identifying suffix.

**History:** Before 3.29.0 the copies were kept next to the monitored file as
`<file>_cfchanges`, or under `repository` if one was configured. On the first
run after an upgrade the copy is moved from either location to
`$(sys.statedir)/change_details`, so no baseline is lost and nothing is left

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so during the upgrade to 3.29.0+ file changes will be moved to change_details from any specified default_repository and default_repository no longer specifies where files are placed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants