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>
|
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.