Skip to content

feat: add /var/lib persistent state directories for collector RPM/DEB packages#1395

Open
dol wants to merge 1 commit intoopen-telemetry:mainfrom
dol:feat/add-var-lib-directories
Open

feat: add /var/lib persistent state directories for collector RPM/DEB packages#1395
dol wants to merge 1 commit intoopen-telemetry:mainfrom
dol:feat/add-var-lib-directories

Conversation

@dol
Copy link

@dol dol commented Mar 1, 2026

RPM/DEB packages for otelcol, otelcol-contrib, and otelcol-otlp were missing /var/lib/<package> directories, preventing the file_storage extension from persisting queue state on disk without manual post-install setup.
Extension is mentioned as part of Resiliency improvements.

Changes

  • cmd/goreleaser/internal/builder.go — adds withVarLibDir(user, group string) helper that appends an nfpm type: dir content entry at /var/lib/<package>, owned by the service user/group at mode 0750
  • cmd/goreleaser/internal/distro_otelcol.go, distro_contrib.go, distro_otlp.go — each calls withVarLibDir with its respective service user/group
  • Generated .goreleaser.yaml files for all three distributions updated accordingly

Resulting nfpm entry (example for otelcol-contrib):

contents:
  - dst: /var/lib/otelcol-contrib
    type: dir
    file_info:
      owner: otelcol-contrib
      group: otelcol-contrib
      mode: 0750

Service users are created by the existing preinstall.sh scripts, so no additional scripting is required.

@dol dol requested a review from a team as a code owner March 1, 2026 17:17
@dol dol requested a review from dehaansa March 1, 2026 17:17
@dol
Copy link
Author

dol commented Mar 1, 2026

CC: Include @swiatekm @VihasMakwana as code owners of the File Storage Extension to this change.

@dol dol force-pushed the feat/add-var-lib-directories branch 2 times, most recently from 2572b74 to 793fa2a Compare March 1, 2026 21:32
… packages

Add packaged /var/lib/<package> directories to otelcol, otelcol-contrib,
and otelcol-otlp distributions. These directories are needed for the
file_storage resiliency extension which persists the collector queue to
disk. See https://opentelemetry.io/docs/collector/resiliency/

- Add withVarLibDir(user, group) helper in builder.go
- Set mode 0750 (rwxr-x---) owned by the service user/group
- Regenerate .goreleaser.yaml files for affected distributions
@dol dol force-pushed the feat/add-var-lib-directories branch from 793fa2a to b705581 Compare March 8, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add /var/lib persistent state directories for collector RPM/DEB packages

3 participants