Repository navigation
Conversation
…tdout
The pipe() and file() destinations of syslog-ng apply the global
owner("root") group("adm") perm(0640) to what they open, unless it is a
character or block device. /docker.stdout is the stdout of the container,
so syslog-ng changed the owner and mode of the pipe of the container
runtime. On gVisor before release-20261005.0, as on DigitalOcean App
Platform, fchmod() on such an imported host file drops its file type
(gvisor/gvisor@3cf8bfde6): no process can open /docker.stdout afterwards,
and PHP-FPM, which opens its access log there since webdevops#656, does not start.
The destination now has empty owner(), group() and perm(), so syslog-ng
leaves the target as it is. 10-init.sh matches the destination without its
options when it switches to file() in tty mode. A file that LOG_STDOUT
names keeps the owner and mode it was created with, instead of becoming
root:adm 0640 on every start.
The image test compares the stdout of the container with its stderr once
syslog-ng has written to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kanti
force-pushed
the
bugfix/syslog-ng-docker-stdout-permissions
branch
from
November 25, 2026 07:43
b539453 to
5d599f7
Compare
…40, test syslog-ng in webdevops/php only With empty owner(), group() and perm(), the mode of a new LOG_STDOUT file depended on the service that opened it first: 0600 root:root in php (syslog-ng), 0644 root:root in php-nginx (Nginx), where master gave 0640 root:adm in both. The entrypoint now creates a missing file as root:adm 0640 before the services start; a file that exists keeps its owner and mode. The tests of syslog-ng move to SyslogChecks, which only PhpTest uses: the images built on webdevops/php share its syslog-ng configuration (AGENTS.md). This also drops the skip for images without syslog-ng, which no image is any more.
…644, and start when they cannot be created 0644 root:root is what Nginx and Apache create; LOG_STDERR was 0644 there before. The entrypoint stops at any error (errexit), so a failing install, e.g. in a read-only directory, stopped the container; it now logs a warning and the container starts, as before the files were created in advance. Image test: with LOG_STDOUT in /proc, the container starts and cron runs.
|
Collaborator
|
Thanks a lot, @redwormik! Tracing this down to I pushed one commit on top:
Thanks again for the fix and the very clear description! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Since #656, PHP-FPM opens its access log at
/docker.stdout. On DigitalOcean App Platform it then does not start: the stdout of the container cannot be opened any more, andfile --dereference /proc/1/fd/1reportsinvalid mode 0640.The
pipe()andfile()destinations of syslog-ng apply the globalowner("root") group("adm") perm(0640)to what they open, unless it is a character or block device (file_opener_open_fd()in syslog-ng)./docker.stdoutis the stdout of the container, so syslog-ng changed the owner and mode of the pipe of the container runtime. App Platform runs gVisor, and gVisor beforerelease-20261005.0drops the file type whenfchmod()is called on an imported host file (gvisor/gvisor@3cf8bfde6). Nginx is not affected because it opens/docker.stdoutbefore syslog-ng starts; PHP-FPM opens it afterwards.The destination now has empty
owner(),group()andperm(), so syslog-ng leaves its target as it is.10-init.shmatches the destination without its options when it switches tofile()in tty mode.For users: a file that
LOG_STDOUTnames keeps the owner and mode it was created with, instead of syslog-ng changing it toroot:adm0640on every start. The documentation does not mention that mode, so it stays as it is.Verified:
testSyslogKeepsTheOwnerAndModeOfTheContainerStdoutfails on the publishedwebdevops/php:8.5-alpine(11a0 root:adminstead of1180 root:root) and passes on that image with the regenerated syslog-ng files (make test-image IMAGE=webdevops/php:8.5-alpine REFERENCE=…). All other image tests pass on both.webdevops/php-nginx:8.5-alpine: syslog-ng makes nofchown/fchmodcalls with stdout as a pipe (pipe()) or as a tty (file()), andloggermessages still reach the container log./proc/1/fd/1stays a FIFO.make checkpasses, exceptcomposer audit, which reports advisories fortwig/twigthat are already onmaster.