Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.

don't mount /var/log as readonly - #314

Merged
rfratto merged 2 commits into
grafana-cold-storage:masterfrom
rfratto:promtail-var-log-readonly
Jan 8, 2021
Merged

don't mount /var/log as readonly#314
rfratto merged 2 commits into
grafana-cold-storage:masterfrom
rfratto:promtail-var-log-readonly

Conversation

@rfratto

@rfratto rfratto commented Jan 7, 2021

Copy link
Copy Markdown
Contributor

PR Description

The /var/log folder is used by default for storing the last read file offset. We were previously mounting this path as readonly. Writing the positions.yaml to this folder helps the Agent recover from a crash and not resend logs that were already sent to Loki.

This change reflects what the official Promtail configs do.

Which issue(s) this PR fixes

Notes to the Reviewer

PR Checklist

  • CHANGELOG updated
  • Documentation added
  • Tests updated

@rfratto
rfratto requested a review from wardbekker January 7, 2021 14:26

@56quarters 56quarters 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.

LGTM. I assume the error was logged in some form already?

@rfratto

rfratto commented Jan 7, 2021

Copy link
Copy Markdown
Contributor Author

LGTM. I assume the error was logged in some form already?

Yeah, Promtail should log it as failed to write positions file

(I'm waiting to merge this, we might end up saving the positions file to /run/agent instead of /var/log instead)

@rfratto
rfratto merged commit a565f2e into grafana-cold-storage:master Jan 8, 2021
@rfratto
rfratto deleted the promtail-var-log-readonly branch January 8, 2021 00:15
@mattdurham mattdurham mentioned this pull request Sep 7, 2021
3 tasks
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
* don't mount /var/log as readonly

* update phrasing in changelog to explain what the issue was
@github-actions github-actions Bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Apr 22, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants