Edit report at https://bugs.php.net/bug.php?id=62033&edit=1
ID: 62033 Comment by: js at justinsamuel dot com Reported by: js at justinsamuel dot com Summary: php-fpm exits with status 0 on some failures to start Status: Feedback Type: Bug Package: FPM related Operating System: Linux (Ubuntu 12.04) PHP Version: 5.4.3 Assigned To: fat Block user comment: N Private report: N New Comment: With the v2 patch this is working as expected: # /opt/test/php5.3/sbin/php-fpm --fpm-config /root/php-test/fpm.conf [25-May-2012 11:08:17] ERROR: [pool example.com] cannot get uid for user 'fakeuser' [25-May-2012 11:08:17] ERROR: FPM initialization failed # echo $? 78 Thanks! Justin Previous Comments: ------------------------------------------------------------------------ [2012-05-25 08:52:06] f...@php.net Hi again, here is a new revision of the patch. Now, when daemonized, the calling process register 2 signal handler for USR1 and USR2 just before forking the master process. After initialization ends on the master process, it sends USR1 if successful or USR2 otherwise to the calling process. On USR1 signal, the calling process exits with 0, on USR2 it exists with error 78 (EX_CONFIG) and if does not receive anything, there's a 10 seconds timeout to exit with code 70 (EX_SOFTWARE). Can you please test it ? thx ++ Jerome ------------------------------------------------------------------------ [2012-05-25 08:48:17] f...@php.net The following patch has been added/updated: Patch Name: bug62033-v2.patch Revision: 1337935697 URL: https://bugs.php.net/patch-display.php?bug=62033&patch=bug62033-v2.patch&revision=1337935697 ------------------------------------------------------------------------ [2012-05-24 00:08:03] js at justinsamuel dot com I've tested this patch with the current PHP-5.3. The problem still persists. A quick look with strace makes it seem that a child process is exiting with the status that is expected from the patch (78) but its parent is not. # rm -f /tmp/php-fpm.strace.* # strace -o /tmp/php-fpm.strace -ff -f /opt/test/php5.3/sbin/php-fpm --fpm-config /root/php-test/fpm.conf [23-May-2012 18:54:57] ERROR: [pool example.com] cannot get uid for user 'fakeuser' [23-May-2012 18:54:57] ERROR: FPM initialization failed # echo $? 0 # ll /tmp/php-fpm.strace.* -rw-r--r-- 1 root root 25282 May 23 18:54 /tmp/php-fpm.strace.996 -rw-r--r-- 1 root root 4125 May 23 18:54 /tmp/php-fpm.strace.997 # grep -B 2 exit /tmp/php-fpm.strace.* /tmp/php-fpm.strace.996-clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f2e60ff19d0) = 997 /tmp/php-fpm.strace.996-munmap(0x7f2e60f60000, 323584) = 0 /tmp/php-fpm.strace.996:exit_group(0) = ? -- /tmp/php-fpm.strace.997-write(3, "[23-May-2012 18:54:57] ERROR: FP"..., 56) = 56 /tmp/php-fpm.strace.997-write(2, "[23-May-2012 18:54:57] ERROR: FP"..., 56) = 56 /tmp/php-fpm.strace.997:exit_group(78) = ? Thanks, Justin ------------------------------------------------------------------------ [2012-05-23 22:51:57] f...@php.net I've attached a real patch to this bug report. Can you please test it ? thx ++ Jerome ------------------------------------------------------------------------ [2012-05-23 22:50:51] f...@php.net The following patch has been added/updated: Patch Name: bug62033.patch Revision: 1337813451 URL: https://bugs.php.net/patch-display.php?bug=62033&patch=bug62033.patch&revision=1337813451 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=62033 -- Edit this bug report at https://bugs.php.net/bug.php?id=62033&edit=1