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

From: Date: Wed, 17 Jun 2015 21:30:58 +0000
Subject: Bug #69865 [NEW]: php-fpm does not close stderr when using syslog
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193631@lists.php.net to get a copy of this message
From: whissi at whissi dot de Operating system: Linux PHP version: 5.6.10 Package: FPM related Bug Type: Bug Bug description:php-fpm does not close stderr when using syslog 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 bug report at https://bugs.php.net/bug.php?id=69865&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69865&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69865&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69865&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69865&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69865&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69865&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69865&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69865&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69865&r=support Expected behavior: https://bugs.php.net/fix.php?id=69865&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69865&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69865&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69865&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69865&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69865&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69865&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69865&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69865&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69865&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69865&r=mysqlcfg

« previous php.bugs (#193631) next »