Skip to content

fix(deb): preserve vector.yaml on upgrade and relocate examples - #26367

Open
yash1262 wants to merge 2 commits into
vectordotdev:masterfrom
yash1262:fix/debian-conffile-examples
Open

yash1262 wants to merge 2 commits into
vectordotdev:masterfrom
yash1262:fix/debian-conffile-examples

Conversation

@yash1262

@yash1262 yash1262 commented Sep 12, 2026

Copy link
Copy Markdown

Summary

  • Declare /etc/vector/vector.yaml as a Debian conffile using an inert placeholder configuration, preserving local edits across upgrades.
  • Move the full demo configuration from /etc/vector/vector.yaml to /usr/share/vector/examples/vector.yaml so fresh installs do not ship an active configuration under /etc.
  • Move bundled example configurations from /etc/vector/examples/ to /usr/share/vector/examples/.
  • Extend scripts/verify-install.sh with static .deb control-file checks and package-specific runtime assertions.
  • Add a regression check to ensure dummy_logs does not reappear in the shipped /etc/vector/vector.yaml.
  • Mark the example-path relocation as a breaking change and update the changelog author metadata to yash1262.

RPM packaging is unchanged because it already uses the correct layout.

Fixes #25856.
Related to #18718.

Test plan

  • Verified .deb static checks against a built package:
    • /etc/vector/vector.yaml is listed in DEBIAN/conffiles.
    • /etc/default/vector remains listed as a conffile.
    • No /etc/vector/examples/* files are listed as conffiles.
  • Verified .deb runtime checks:
    • /etc/vector/vector.yaml exists at the canonical path.
    • The shipped /etc/vector/vector.yaml is inert and does not contain dummy_logs.
    • /etc/vector/examples/ is absent.
    • /usr/share/vector/examples/vector.yaml is present.
  • Verified .rpm runtime checks continue to pass.
  • Confirmed Alpine and distroless-static Docker images copy config/vector.yaml directly and are unaffected by this change.

Migration

Users or scripts referencing example configurations under /etc/vector/examples/ must update those paths to /usr/share/vector/examples/.

@yash1262
yash1262 requested a review from a team as a code owner September 12, 2026 18:29
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

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

@yash1262

Copy link
Copy Markdown
Author

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

@yash1262

Copy link
Copy Markdown
Author

recheck

@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: f8adeae6a4

ℹ️ 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 Outdated
Comment thread changelog.d/18718_debian_example_conffiles.fix.md Outdated
Comment thread changelog.d/18718_debian_example_conffiles.fix.md Outdated
@yash1262

Copy link
Copy Markdown
Author

recheck

@yash1262
yash1262 force-pushed the fix/debian-conffile-examples branch from f8adeae to 2c38729 Compare September 12, 2026 18:50
@github-actions github-actions Bot added meta: breaking change Anything that breaks backward compatibility. domain: releasing Anything related to releasing Vector labels Sep 12, 2026

@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: 2c387292de

ℹ️ 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
section = "admin"
maintainer-scripts = "distribution/debian/scripts/"
conf-files = ["/etc/default/vector"]
conf-files = ["/etc/vector/vector.yaml", "/etc/default/vector"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid converting an unowned config directly into a conffile

For Debian installations created since 0.56, administrators were instructed to create /etc/vector/vector.yaml themselves while the package did not own that path. On upgrade, adding a different package-owned conffile at the same path makes dpkg request a conffile decision; interactive upgrades now require action, and noninteractive dpkg -i can fail on EOF unless callers explicitly supply --force-confold or --force-confnew (which dpkg --force-help documents as the options that avoid prompting). The new verification only reinstalls a version that already registered the conffile, so it does not exercise this migration. Add an upgrade-safe transition that preserves the formerly unowned file without prompting.

Useful? React with 👍 / 👎.

@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: 3f3051a3c9

ℹ️ 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".

if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
if [ -e "$VECTOR_CONF" ] && [ ! -L "$VECTOR_CONF" ]; then
if ! dpkg-query -W -f='${Conffiles}' vector 2>/dev/null | grep -qF " $VECTOR_CONF "; then
cp -a "$VECTOR_CONF" "$VECTOR_CONF_BACKUP"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move the original config aside before unpacking

On an upgrade from a post-0.56 package where an administrator created this previously untracked path, cp -a leaves the original at the new conffile destination, so dpkg still opens its conffile prompt before postinst can restore the backup. In the Debian verification workflow, the plain dpkg -i then exits on EOF in a noninteractive runner; dpkg --force-help describes confold/confnew as the options that avoid prompting. Fresh evidence after the earlier review is that this newly added copy operation does not remove the destination that triggers the prompt; move the original aside before unpacking instead, with failure-safe restoration.

Useful? React with 👍 / 👎.

Comment thread Cargo.toml
["distribution/debian/vector.yaml", "/etc/vector/vector.yaml", "644"],
["config/vector.yaml", "/usr/share/vector/examples/vector.yaml", "644"],
["config/examples/*", "/etc/vector/examples/", "644"],
["config/examples/*", "/usr/share/vector/examples/", "644"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the obsolete example conffiles during upgrade

For existing Debian installations, changing this asset destination does not remove the former /etc/vector/examples/* conffiles: dpkg retains them and marks them obsolete, leaving stale examples and the old directory in place indefinitely despite the migration claiming they moved. dpkg-maintscript-helper --help explicitly describes rm_conffile as removing an obsolete conffile and requiring calls from preinst, postinst, and postrm; add that transition for the previously shipped example files and exercise an actual old-package upgrade rather than only a clean install.

Useful? React with 👍 / 👎.

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 meta: breaking change Anything that breaks backward compatibility.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debian package: conffile and example configurations are installed under /etc

1 participant