Skip to content

chore(logrotate): make the default value show the separator it documents - #67

Merged
zebby76 merged 1 commit into
Smals-Webtech:mainfrom
zebby76:chore/logrotate-default-shows-the-separator
Sep 4, 2026
Merged

chore(logrotate): make the default value show the separator it documents#67
zebby76 merged 1 commit into
Smals-Webtech:mainfrom
zebby76:chore/logrotate-default-shows-the-separator

Conversation

@zebby76

@zebby76 zebby76 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #58, spotted while reviewing what actually reaches production.

The splitting fix accepts both forms: a value containing ; or a newline is split on it, anything
else falls back to whitespace — which keeps every value that worked before working. The shipped
default stayed on the whitespace form.

That is the wrong thing to hand someone. The default is what gets copied and extended, and copying
it to add a directive with an argument produces

"compress copytruncate missingok notifempty maxage 7"

which has no ;, takes the whitespace path, and renders 7 and maxage as two lines. Since #58
the container refuses to boot on that rather than rotating nothing in silence — so the failure is
loud — but the value it was copied from is what led there.

Change

The default is semicolon-separated. Nothing about the parsing changes:

LOGROTATE_DEFAULT_OPTIONS result
the new default, untouched rotates, stanza unchanged
the default copied and extended with maxage 7 rotates, maxage 7 intact
an old whitespace override rotates, stanza unchanged

The README row said "space-separated". It now names the separator, gives an example of a directive
that takes an argument, and mentions that the rendered stanza is validated at startup.

Related, in the sibling image

base-nginx never received #58 at all — 70-logrotate.sh there still word-splits and sorts, with no
validation. Its twin is going up separately.

The splitting fix accepts both forms: a value containing ';' or a newline is
split on it, anything else falls back to whitespace, which keeps every value
that worked before working. The shipped default stayed on the whitespace form.

That is the wrong thing to hand someone. The default is what gets copied and
extended, and copying it to add a directive with an argument produces

  "compress copytruncate missingok notifempty maxage 7"

which has no ';', takes the whitespace path, and renders "7" and "maxage" as two
lines. The container now refuses to boot on that rather than rotating nothing in
silence, so the failure is loud -- but the value it was copied from is what led
there.

The default is semicolon-separated now. Nothing about the parsing changes, and
an operator already overriding it with the whitespace form is unaffected:

  default, untouched                       rotates, stanza unchanged
  default copied and extended, maxage 7    rotates, "maxage 7" intact
  whitespace override                      rotates, stanza unchanged

The README row said "space-separated" and now says what the separator is, gives
an example of a directive with an argument, and mentions that the rendered
stanza is validated at startup.
@zebby76
zebby76 merged commit 960c15f into Smals-Webtech:main Sep 4, 2026
19 checks passed
zebby76 added a commit that referenced this pull request Sep 4, 2026
…nts (#67) (#68)

The splitting fix accepts both forms: a value containing ';' or a newline is
split on it, anything else falls back to whitespace, which keeps every value
that worked before working. The shipped default stayed on the whitespace form.

That is the wrong thing to hand someone. The default is what gets copied and
extended, and copying it to add a directive with an argument produces

  "compress copytruncate missingok notifempty maxage 7"

which has no ';', takes the whitespace path, and renders "7" and "maxage" as two
lines. The container now refuses to boot on that rather than rotating nothing in
silence, so the failure is loud -- but the value it was copied from is what led
there.

The default is semicolon-separated now. Nothing about the parsing changes, and
an operator already overriding it with the whitespace form is unaffected:

  default, untouched                       rotates, stanza unchanged
  default copied and extended, maxage 7    rotates, "maxage 7" intact
  whitespace override                      rotates, stanza unchanged

The README row said "space-separated" and now says what the separator is, gives
an example of a directive with an argument, and mentions that the rendered
stanza is validated at startup.
@zebby76
zebby76 deleted the chore/logrotate-default-shows-the-separator branch September 4, 2026 19:12
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.

1 participant