Skip to content

fix(debian): preserve vector.yaml as a conffile + move examples to docs folder - #25884

Open
koen-serry wants to merge 17 commits into
vectordotdev:masterfrom
koen-serry:fix-debian-conffiles
Open

koen-serry wants to merge 17 commits into
vectordotdev:masterfrom
koen-serry:fix-debian-conffiles

Conversation

@koen-serry

@koen-serry koen-serry commented Jul 17, 2026 •

Copy link
Copy Markdown

Summary

Two Debian packaging fixes.

1. /etc/vector/vector.yaml is now a proper dpkg conffile. Previously the Debian package shipped no file at this path, so an administrator's config there was unknown to dpkg. This PR adds a stub config (no active sources/sinks) as a conf-files entry, so local modifications are preserved across upgrades the way dpkg handles conffiles.

Because the path was not previously a conffile, a file already sitting there — user-created, or left by an earlier Vector version — would make dpkg stop at the interactive "file created by you" conffile prompt, which breaks unattended apt/dpkg upgrades. The maintainer scripts handle that transition without ever prompting:

  • preinst moves an existing, dpkg-untracked /etc/vector/vector.yaml aside to .vector-preserve, so dpkg unpacks the new conffile onto a free path. It skips the move when the file is already a (non-obsolete) conffile of this package, and when another package owns the path, so dpkg's own file-conflict check still fires.
  • postinst restores the preserved file, keeping the user's content byte-for-byte.
  • postrm restores it again on abort-install/abort-upgrade, so a failure between preinst and postinst cannot leave Vector without the config it was running with, and removes the leftover on purge.

2. Example configs moved from /etc/vector/examples/ to /usr/share/doc/vector/examples/. They are documentation, not administrator-managed configuration, so /etc is the wrong home for them. Since cargo-deb treated the old /etc paths as conffiles, preinst/postinst/postrm carry the matching dpkg-maintscript-helper rm_conffile transitions (prior version 0.57.0-1) so unmodified old copies are removed and modified ones are preserved as backups.

Vector configuration

The shipped stub at /etc/vector/vector.yaml is inert by design — see distribution/debian/vector.yaml, no active sources or sinks.

How did you test this PR?

scripts/verify-install.sh is extended to cover the transition and runs in CI for the .deb: it seeds an unmanaged /etc/vector/vector.yaml before installing the package, then asserts the content survived. dpkg has no tty there, so a conffile prompt would hang or fail the job — the absence of a prompt is what the test actually proves. It also asserts the new file layout: /etc/vector/vector.yaml present, nothing under /etc/vector/examples, examples present under /usr/share/doc/vector/examples/. The .rpm path keeps its previous expectations.

All three maintainer scripts are syntax-checked, and the changelog fragment passes vdev check changelog-fragments.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

Fragment: changelog.d/deb-conffile-examples-location.fix.md.

References

N/A

@koen-serry
koen-serry requested a review from a team as a code owner July 17, 2026 15:08
@github-actions github-actions Bot added the domain: releasing Anything related to releasing Vector label Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ghost

This comment has been minimized.

@koen-serry

Copy link
Copy Markdown
Author

I have no clue what that CLA Assistant is

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7bc4e400cc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Cargo.toml
@koen-serry

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

…file

Since /etc/vector/vector.yaml was not a dpkg conffile before this change,
a file already present at that path (created by a user, or by an older
Vector package) is unknown to dpkg. Unpacking it as a new conffile makes
dpkg treat it as "created by you" and stop at an interactive prompt,
which breaks unattended upgrades without --force-confold/confnew.

Add a preinst/postinst transition: preinst moves aside any untracked
pre-existing file so dpkg can install the conffile without prompting,
and postinst restores it afterwards so the content is preserved
byte-for-byte. Once installed this way the path is a normal tracked
conffile and standard dpkg conffile handling applies on later upgrades.

Extend verify-install.sh to seed such an untracked file before the first
install and assert it survives, since the existing verify path only
reinstalled the same package and never exercised this transition.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1bc7cbd4b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Cargo.toml
Comment thread distribution/debian/scripts/preinst Outdated
Comment thread distribution/debian/scripts/preinst

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbd27f3a80

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread distribution/debian/scripts/preinst Outdated
Comment thread distribution/debian/scripts/postinst
@pront pront added the meta: awaiting author Pull requests that are awaiting their author. label Jul 29, 2026
@github-actions github-actions Bot removed the meta: awaiting author Pull requests that are awaiting their author. label Aug 22, 2026
koen-serry and others added 4 commits September 21, 2026 22:09
…n ownership

Add the postrm half of the rm_conffile transition for the old
/etc/vector/examples/*.yaml conffiles, as dpkg-maintscript-helper
requires, so an aborted upgrade restores them and a purge cleans up its
backups.

Also restore a preserved /etc/vector/vector.yaml from postrm on
abort-install/abort-upgrade, so a failure between preinst and postinst
never leaves Vector without the config it was running with, and skip the
preserve move entirely when another package owns the file so dpkg's own
file-conflict check still reports the conflict. The conffile lookup now
ignores entries dpkg marks obsolete.
@pront

pront commented Sep 22, 2026

Copy link
Copy Markdown
Member

@codex review

@koen-serry

Copy link
Copy Markdown
Author

@pront friendly ping on this one. Since your last look:

  • Merged latest master (branch is up to date, clean merge).
  • All Codex review threads are resolved — postrm now carries the rm_conffile half and the abort-install/abort-upgrade restore, and preinst skips the preserve move when another package owns the path.
  • Filled in the PR description, which was still the blank template. Changelog fragment is in place and validates.

CI has not run since 72c871a16 — every push re-enters the fork workflow-approval gate, so it would need the approve-and-run click whenever you next get a chance.

Happy to address anything else here.

This branch has not been deployed

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

Labels

domain: releasing Anything related to releasing Vector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants