Skip to content

[BUGFIX] Let syslog-ng take the messages of the services on Alpine - #623

Merged
Kanti merged 1 commit into
webdevops:masterfrom
andersundsehr:bugfix/syslog-alpine-datagrams
Nov 15, 2026
Merged

Kanti merged 1 commit into
webdevops:masterfrom
andersundsehr:bugfix/syslog-alpine-datagrams

Conversation

@Kanti

@Kanti Kanti commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

syslog-ng listened on /dev/log as a stream socket. syslog() of musl sends datagrams only, so on Alpine the messages of cron, Postfix and logger were lost: they reached neither the container log nor the file of LOG_STDOUT. syslog-ng now listens on a datagram socket. glibc tries datagrams first, so Debian and Ubuntu behave as before.

Related issues: none found.

Changes

  • provisioning/base/general/etc/syslog-ng/syslog-ng.conf: unix-dgram("/dev/log") instead of unix-stream; make generate.
  • Image tests:
    • testSyslogMessagesReachTheFileFromTheEnvironment: a message sent with logger arrives in the file of LOG_STDOUT. syslog-ng is started where the image does not start it.
    • testCronRunsJobsInTheTimeZoneFromTheEnvironment: cron also logs the job at the level of SERVICE_CRON_OPTS (-L 15 on Debian logs its end, -l 0 on Alpine its start). This replaces the check in testServiceOptionsFromTheEnvironment, which only looked for the option in the command line of cron.
  • Docs: the known issue "syslog on Alpine" and the note on it in docs/environment-variables.md are removed.

How it was verified

Image Published image With the fix
php-nginx:8.5-alpine 2 failures: the cron log line and the logger message are missing all 185 tests pass
base:alpine 1 failure: the logger message is missing all 81 tests pass
php-nginx-dev:8.5 (Debian) passes all 195 tests pass

"With the fix" is the published image with the new syslog-ng.conf in place of the old one. The two files differ only in the /dev/log line.

The runs of base:alpine and php-nginx-dev:8.5 are from before the rebase onto the current master; the change and its tests are the same. GrumPHP passes, and ci/console generate changes nothing.

Not verified: a full build of the images, a GitHub Actions run, arm64.

syslog-ng listened on /dev/log as a stream socket. syslog() of musl, and
so cron, Postfix and logger on Alpine, sends datagrams only, so their
messages were lost: they reached neither the container log nor the file of
LOG_STDOUT. A datagram socket takes them; glibc tries datagrams first too,
so nothing changes on Debian and Ubuntu.

The image tests send a message with logger and check that it arrives, and
that cron logs a job at the level of SERVICE_CRON_OPTS.
@sonarqubecloud

Copy link
Copy Markdown

@Kanti
Kanti marked this pull request as ready for review November 15, 2026 15:28
@Kanti
Kanti merged commit 4f049d9 into webdevops:master Nov 15, 2026
521 of 525 checks passed
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