Bug #69865 [Com]: php-fpm does not close stderr when using syslog

From: Date: Mon, 23 Nov 2015 00:25:06 +0000
Subject: Bug #69865 [Com]: php-fpm does not close stderr when using syslog
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197373@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69865&edit=1 ID: 69865 Comment by: whissi at whissi dot de Reported by: whissi at whissi dot de Summary: php-fpm does not close stderr when using syslog Status: Open Type: Bug Package: FPM related Operating System: Linux PHP Version: 5.6.10 Block user comment: N Private report: N New Comment: PR php-src/1432 fixes the problem for me. Thank you Michael! Previous Comments: ------------------------------------------------------------------------ [2015-06-17 21:30:56] whissi at whissi dot de Description: ------------ Bug-Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=548166 When php-fpm uses syslog, php-fpm won't close stderr. As result you cannot use Python's subprocess module to start/restart php-fpm for example. That's how I run into that problem: I tried salt (a configuration management tool) to restart php-fpm, see https://github.com/saltstack/salt/issues/14957 According to http://www.freedesktop.org/software/systemd/man/daemon.html (9) a daemonized service should connect /dev/null to standard input, output, and error. Can we do the same with php-fpm? PS: A similar problem was found with udev which got accepted and fixed, see https://github.com/systemd/systemd/issues/190 The bug is at least present in 5.5.26 and 5.6.10. Test script: --------------- In you "php-fpm.conf" set error_log = syslog Now restart php-fpm and verify with something like for i in /proc/$(pgrep --uid 0 php-fpm)/fd/*; do echo $i $(readlink $i); done ("--uid 0" to select only the php-fpm master process) Expected result: ---------------- /proc/6004/fd/0 /dev/null /proc/6004/fd/1 /dev/null /proc/6004/fd/2 /dev/null /proc/6004/fd/3 /tmp/.ZendSem.Fu3Gpo (deleted) /proc/6004/fd/4 socket:[19110] /proc/6004/fd/6 socket:[19111] /proc/6004/fd/7 socket:[19112] /proc/6004/fd/8 anon_inode:[eventpoll] /proc/6004/fd/9 socket:[19116] Actual result: -------------- /proc/6004/fd/0 /dev/null /proc/6004/fd/1 /dev/null /proc/6004/fd/2 /dev/pts/1 /proc/6004/fd/3 /tmp/.ZendSem.Fu3Gpo (deleted) /proc/6004/fd/4 socket:[19110] /proc/6004/fd/6 socket:[19111] /proc/6004/fd/7 socket:[19112] /proc/6004/fd/8 anon_inode:[eventpoll] /proc/6004/fd/9 socket:[19116] ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69865&edit=1

« previous php.bugs (#197373) next »