Skip to content

Commit 0cad701

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
2 parents bec22af + cc5c51e commit 0cad701

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PHP NEWS
77
Spagnoletti)
88

99
- FPM:
10+
. Fixed bug #77934 (php-fpm kill -USR2 not working). (Jakub Zelenka)
1011
. Fixed bug #77921 (static.php.net doesn't work anymore). (Peter Kokot)
1112

1213
- GD:

sapi/fpm/fpm/fpm_signals.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void sig_soft_quit(int signo) /* {{{ */
142142
int saved_errno = errno;
143143

144144
/* closing fastcgi listening socket will force fcgi_accept() exit immediately */
145-
close(0);
145+
close(fpm_globals.listening_socket);
146146
if (0 > socket(AF_UNIX, SOCK_STREAM, 0)) {
147147
zlog(ZLOG_WARNING, "failed to create a new socket");
148148
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--TEST--
2+
FPM: bug77934 - php-fpm kill -USR2 not working
3+
--SKIPIF--
4+
<?php include "skipif.inc"; ?>
5+
--FILE--
6+
<?php
7+
8+
require_once "tester.inc";
9+
10+
$cfg = <<<EOT
11+
[global]
12+
error_log = {{FILE:LOG}}
13+
pid = {{FILE:PID}}
14+
process_control_timeout=20
15+
[unconfined]
16+
listen = {{ADDR}}
17+
pm = dynamic
18+
pm.max_children = 5
19+
pm.start_servers = 1
20+
pm.min_spare_servers = 1
21+
pm.max_spare_servers = 1
22+
EOT;
23+
24+
$tester = new FPM\Tester($cfg);
25+
$tester->start();
26+
$tester->expectLogStartNotices();
27+
$tester->signal('USR2');
28+
$tester->expectLogNotice('Reloading in progress ...');
29+
$tester->expectLogNotice('reloading: .*');
30+
$tester->expectLogNotice('using inherited socket fd=\d+, "127.0.0.1:\d+"');
31+
$tester->expectLogStartNotices();
32+
$tester->terminate();
33+
$tester->expectLogTerminatingNotices();
34+
$tester->close();
35+
36+
?>
37+
Done
38+
--EXPECT--
39+
Done
40+
--CLEAN--
41+
<?php
42+
require_once "tester.inc";
43+
FPM\Tester::clean();
44+
?>

0 commit comments

Comments
 (0)