-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- when running in docker, php-fpm child proceses can't write to log files which are symbolic linked to /dev/stderr. seems to be related to permissions and how cake/php uses fopen when writing to pipes. - this fix create pipes before starting the php-fpm master process. these pipes are redirected to stderr
- Loading branch information
Showing
2 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
# hacks to allow php-fpm child process to write to log files that redirected to stderr | ||
# similar to https://github.com/moby/moby/issues/6880#issuecomment-344114520 | ||
chown www-data:www-data /var/www/html/app/tmp/logs | ||
for f in /var/www/html/app/tmp/logs/api.log \ | ||
/var/www/html/app/tmp/logs/debug.log \ | ||
/var/www/html/app/tmp/logs/error.log \ | ||
/var/www/html/app/tmp/logs/login.log | ||
do | ||
rm -f $f | ||
mkfifo -m 600 $f | ||
chown www-data:www-data $f | ||
cat <> $f 1>&2 & | ||
done | ||
|
||
php-fpm |