php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53074 Sending php-fpm service a HUP signal causes problems with daemontools
Submitted: 2010-10-15 11:30 UTC Modified: 2021-12-11 22:01 UTC
Votes:4
Avg. Score:3.5 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: juangiordana at gmail dot com Assigned: bukka (profile)
Status: Closed Package: FPM related
PHP Version: 5.3.3 OS: Linux (funtoo/gentoo)
Private report: No CVE-ID: None
 [2010-10-15 11:30 UTC] juangiordana at gmail dot com
Description:
------------
I'm running php-fpm with DJB daemontools (daemonize = no) process supervisor.

Every time I send the process a HUP signal (graceful reload) the process is in some way "detached" from daemontools so it's not possible to reload it because it's already runninng.

Since the children processes aren't properly (?) terminated, php-fpm refuses to start:

Test script:
---------------
# ps axf
 1806 ?        Ss     0:00 /bin/sh /command/svscanboot
 1809 ?        S      0:02  \_ svscan /service
 1811 ?        S      0:00  |   \_ supervise nginx
 1861 ?        S      0:00  |   |   \_ nginx: master process /usr/local/sbin/nginx -c /usr/local/etc/nginx/nginx.conf
 1947 ?        S      0:00  |   |       \_ nginx: worker process                                   
 1812 ?        S      0:00  |   \_ supervise log
 1862 ?        S      0:00  |   |   \_ /command/multilog t s10000000 n30 /var/log/nginx
 1824 ?        S      0:00  |   \_ supervise php-fpm
20807 ?        Ss     0:00  |   |   \_ /usr/local/sbin/php-fpm --fpm-config /usr/local/etc/php/php-fpm.conf
20808 ?        S      0:00  |   |       \_ /usr/local/sbin/php-fpm --fpm-config /usr/local/etc/php/php-fpm.conf
20809 ?        S      0:00  |   |       \_ /usr/local/sbin/php-fpm --fpm-config /usr/local/etc/php/php-fpm.conf
20810 ?        S      0:00  |   |       \_ /usr/local/sbin/php-fpm --fpm-config /usr/local/etc/php/php-fpm.conf
 1825 ?        S      0:00  |   \_ supervise log

# svc -h /service/php-fpm
# ps axf
14606 ?        S      0:01 /srv/bin/php-cgi --fpm --fpm-config /srv/etc/php/php-fpm.conf
14607 ?        S      0:00 /srv/bin/php-cgi --fpm --fpm-config /srv/etc/php/php-fpm.conf
14608 ?        S      0:01 /srv/bin/php-cgi --fpm --fpm-config /srv/etc/php/php-fpm.conf

# tailf /var/log/php-fpm/current 
@400000004cb81c1f223b929c Oct 15 06:17:09.545883 [ERROR] bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004cb81c1f34789c0c Oct 15 06:17:09.880267 [WARNING] [pool www] pm.start_servers is not set. It's been set to 3.
@400000004cb81c1f35767854 Oct 15 06:17:09.880736 [ERROR] bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004cb81c203798141c Oct 15 06:17:10.932654 [WARNING] [pool www] pm.start_servers is not set. It's been set to 3.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-21 23:17 UTC] fat@php.net
-Status: Open +Status: Feedback
 [2010-10-21 23:17 UTC] fat@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


This could be the same problem as bug 52501.

Can you test the patch attached to the bug 52501 please ?
 [2011-10-08 14:23 UTC] fat@php.net
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: fat
 [2011-10-12 19:55 UTC] juangiordana at gmail dot com
Hello fat,

I forgot to run the patch at that time and since it has been incorporated to the core, I thought it would be good to send the information again.

Tested using PHP version 5.3.8.
Output has been shortened for the sake of brevity.

See PIDs 4645 to 4649 in the php-fpm-address.log file

See PIDs 4942 to 4946 in the php-fpm-address.log file.

When binding to address:port it doesn't start again.

When binding to a socket it starts again but previous childs are detached from the master process.
 [2011-10-12 19:58 UTC] fat@php.net
-Status: Closed +Status: Assigned
 [2011-10-12 20:02 UTC] juangiordana at gmail dot com
Fat, 

I can't find a way to attach a file. Let me know and I'll send you the raw text output via e-mail if you need it.

Thanks.

################################################################################
# php-fpm-address.log
################################################################################


# php -v
PHP 5.3.8 (cli) (built: Aug 29 2011 19:45:22)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

# php-fpm -v
PHP 5.3.8 (fpm-fcgi) (built: Aug 29 2011 19:45:20)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

# grep -v '^;' /usr/local/etc/php/php-fpm.conf
[global]
pid = /var/run/php-fpm.pid
error_log = /var/log/php-fpm.log
daemonize = no

[www]
listen = 127.0.0.1:9000
user = apache
group = apache
pm = dynamic
pm.max_children = 10
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 5
pm.status_path = /status
ping.path = /ping
request_slowlog_timeout = 10
slowlog = /var/log/php-fpm.log.slow


---
--- Step 1: Empty log.
---
# > /var/log/php-fpm/current

# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      2630  0.0  0.0   3744   292 ?        S    15:18   0:00  |   \_ supervise log
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.2  0.1  21104  3364 tty1     S    16:23   0:00  \_ -bash
root      4635  0.0  0.0  11252  1344 tty1     S+   16:25   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4639  0.0  0.0  16936  1088 tty1     R+   16:25   0:00          \_ ps axfu


---
--- Step 2: Start service.
---
# svc -u /service/php-fpm/log /service/php-fpm
# sleep 10
# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      4643  0.1  0.4 127524  8380 ?        Ss   16:25   0:00  |   |   \_ php-fpm: master process (/usr/local/etc/php/php-fpm.conf)
apache    4645  0.0  0.1 127524  3340 ?        S    16:25   0:00  |   |       \_ php-fpm: pool www
apache    4646  0.0  0.1 127524  3340 ?        S    16:25   0:00  |   |       \_ php-fpm: pool www
apache    4647  0.0  0.1 127524  3340 ?        S    16:25   0:00  |   |       \_ php-fpm: pool www
apache    4648  0.0  0.1 127524  3340 ?        S    16:25   0:00  |   |       \_ php-fpm: pool www
apache    4649  0.0  0.1 127524  3340 ?        S    16:25   0:00  |   |       \_ php-fpm: pool www
root      2630  0.0  0.0   3744   292 ?        S    15:18   0:00  |   \_ supervise log
root      4642  0.0  0.0   3756   296 ?        S    16:25   0:00  |       \_ /command/multilog t s10000000 n30 /var/log/php-fpm
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.1  0.1  21104  3364 tty1     S    16:23   0:00  \_ -bash
root      4635  0.0  0.0  11252  1376 tty1     S+   16:25   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4651  0.0  0.0  16936  1108 tty1     R+   16:26   0:00          \_ ps axfu

# tail /var/log/php-fpm/current
@400000004e95e9cb09d14864 [12-Oct-2011 16:25:53] NOTICE: fpm is running, pid 4643
@400000004e95e9cb09e564d4 [12-Oct-2011 16:25:53] NOTICE: ready to handle connections


---
--- Step 3: Send service the HUP signal.
---
# svc -h /service/php-fpm
# sleep 10
# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      4664  0.0  0.0      0     0 ?        Zs   16:26   0:00  |   |   \_ [php-fpm] <defunct>
root      2630  0.0  0.0   3744   292 ?        S    15:18   0:00  |   \_ supervise log
root      4642  0.0  0.0   3756   296 ?        S    16:25   0:00  |       \_ /command/multilog t s10000000 n30 /var/log/php-fpm
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.1  0.1  21104  3364 tty1     S    16:23   0:00  \_ -bash
root      4635  0.0  0.0  11252  1380 tty1     S+   16:25   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4665  0.0  0.0  16936  1104 tty1     R+   16:26   0:00          \_ ps axfu
apache    4645  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4646  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4647  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4648  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4649  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www

# tail /var/log/php-fpm/current
@400000004e95e9d50a66e914 [12-Oct-2011 16:26:03] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d60bcc7454 [12-Oct-2011 16:26:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d70d0efea4 [12-Oct-2011 16:26:05] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d80e767614 [12-Oct-2011 16:26:06] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d90fba40b4 [12-Oct-2011 16:26:07] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9da10fff39c [12-Oct-2011 16:26:08] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9db12475434 [12-Oct-2011 16:26:09] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9dc138cff4c [12-Oct-2011 16:26:10] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9dd14d7422c [12-Oct-2011 16:26:11] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9de161b531c [12-Oct-2011 16:26:12] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)


---
--- Step 4: Stop service.
---
# svc -d /service/php-fpm /service/php-fpm/log
# sleep 10
# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      2630  0.0  0.0   3744   292 ?        S    15:18   0:00  |   \_ supervise log
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.1  0.1  21104  3364 tty1     S    16:23   0:00  \_ -bash
root      4635  0.0  0.0  11252  1380 tty1     S+   16:25   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4669  0.0  0.0  16936  1104 tty1     R+   16:26   0:00          \_ ps axfu
apache    4645  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4646  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4647  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4648  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www
apache    4649  0.0  0.1 127524  3340 ?        S    16:25   0:00 php-fpm: pool www

# tail /var/log/php-fpm/current
@400000004e95e9d50a66e914 [12-Oct-2011 16:26:03] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d60bcc7454 [12-Oct-2011 16:26:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d70d0efea4 [12-Oct-2011 16:26:05] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d80e767614 [12-Oct-2011 16:26:06] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9d90fba40b4 [12-Oct-2011 16:26:07] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9da10fff39c [12-Oct-2011 16:26:08] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9db12475434 [12-Oct-2011 16:26:09] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9dc138cff4c [12-Oct-2011 16:26:10] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9dd14d7422c [12-Oct-2011 16:26:11] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
@400000004e95e9de161b531c [12-Oct-2011 16:26:12] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)


################################################################################
# php-fpm-socket.log
################################################################################

# php -v
PHP 5.3.8 (cli) (built: Aug 29 2011 19:45:22)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

# php-fpm -v
PHP 5.3.8 (fpm-fcgi) (built: Aug 29 2011 19:45:20)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

# grep -v '^;' /usr/local/etc/php/php-fpm.conf
[global]
pid = /var/run/php-fpm.pid
error_log = /var/log/php-fpm.log
daemonize = no

[www]
listen = /var/run/php-fpm.sock
user = apache
group = apache
pm = dynamic
pm.max_children = 10
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 5
pm.status_path = /status
ping.path = /ping
request_slowlog_timeout = 10
slowlog = /var/log/php-fpm.log.slow


---
--- Step 1: Empty log.
---
# > /var/log/php-fpm/current

# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      2630  0.0  0.0   3744   292 ?        S    15:18   0:00  |   \_ supervise log
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.1  0.1  21104  3380 tty1     S    16:23   0:00  \_ -bash
root      4932  0.0  0.0  11252  1344 tty1     S+   16:30   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4936  0.0  0.0  16936  1088 tty1     R+   16:30   0:00          \_ ps axfu


---
--- Step 2: Start service.
---
# svc -u /service/php-fpm/log /service/php-fpm
# sleep 10
# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      4939  0.0  0.4 127524  8372 ?        Ss   16:30   0:00  |   |   \_ php-fpm: master process (/usr/local/etc/php/php-fpm.conf)
apache    4942  0.0  0.1 127524  3336 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4943  0.0  0.1 127524  3336 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4944  0.0  0.1 127524  3336 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4945  0.0  0.1 127524  3336 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4946  0.0  0.1 127524  3336 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
root      2630  0.0  0.0   3744   388 ?        S    15:18   0:00  |   \_ supervise log
root      4940  0.0  0.0   3756   296 ?        S    16:30   0:00  |       \_ /command/multilog t s10000000 n30 /var/log/php-fpm
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.1  0.1  21104  3380 tty1     S    16:23   0:00  \_ -bash
root      4932  0.1  0.0  11252  1376 tty1     S+   16:30   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4947  0.0  0.0  16936  1108 tty1     R+   16:30   0:00          \_ ps axfu

# tail /var/log/php-fpm/current
@400000004e95eadd2158eb2c [12-Oct-2011 16:30:27] NOTICE: fpm is running, pid 4939
@400000004e95eadd216d4dec [12-Oct-2011 16:30:27] NOTICE: ready to handle connections


---
--- Step 3: Send service the HUP signal.
---
# svc -h /service/php-fpm
# sleep 10
# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      4950  0.0  0.4 127524  8380 ?        Ss   16:30   0:00  |   |   \_ php-fpm: master process (/usr/local/etc/php/php-fpm.conf)
apache    4952  0.0  0.1 127524  3344 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4953  0.0  0.1 127524  3344 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4954  0.0  0.1 127524  3344 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4955  0.0  0.1 127524  3344 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
apache    4956  0.0  0.1 127524  3344 ?        S    16:30   0:00  |   |       \_ php-fpm: pool www
root      2630  0.0  0.0   3744   388 ?        S    15:18   0:00  |   \_ supervise log
root      4940  0.0  0.0   3756   296 ?        S    16:30   0:00  |       \_ /command/multilog t s10000000 n30 /var/log/php-fpm
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.1  0.1  21104  3380 tty1     S    16:23   0:00  \_ -bash
root      4932  0.1  0.0  11252  1380 tty1     S+   16:30   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4957  0.0  0.0  16936  1112 tty1     R+   16:30   0:00          \_ ps axfu
apache    4942  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4943  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4944  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4945  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4946  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www

# tail /var/log/php-fpm/current
@400000004e95eadd2158eb2c [12-Oct-2011 16:30:27] NOTICE: fpm is running, pid 4939
@400000004e95eadd216d4dec [12-Oct-2011 16:30:27] NOTICE: ready to handle connections
@400000004e95eae722524b04 [12-Oct-2011 16:30:37] NOTICE: fpm is running, pid 4950
@400000004e95eae722664c1c [12-Oct-2011 16:30:37] NOTICE: ready to handle connections


---
--- Step 4: Stop service.
---
# svc -d /service/php-fpm /service/php-fpm/log
# sleep 10
# ps axfu
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    15:18   0:00 [kthreadd]
root         1  0.0  0.0   3892   712 ?        Ss   15:18   0:00 init [3]
root       876  0.0  0.0  12516   860 ?        S<s  15:18   0:00 /sbin/udevd --daemon
root      1375  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      1376  0.0  0.0  12512   812 ?        S<   15:18   0:00  \_ /sbin/udevd --daemon
root      2592  0.0  0.0  18464   808 ?        Ss   15:18   0:00 /usr/sbin/cron
root      2609  0.0  0.0  14296   828 tty2     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty2 linux
root      2610  0.0  0.0  14296   836 tty3     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty3 linux
root      2611  0.0  0.0  14296   836 tty4     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty4 linux
root      2612  0.0  0.0  14296   836 tty5     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty5 linux
root      2613  0.0  0.0  14296   832 tty6     Ss+  15:18   0:00 /sbin/agetty --noclear 38400 tty6 linux
root      2614  0.0  0.0   9232  1256 ?        Ss   15:18   0:00 /bin/sh /command/svscanboot
root      2616  0.0  0.0   3916   448 ?        S    15:18   0:00  \_ svscan /service
root      2629  0.0  0.0   3744   392 ?        S    15:18   0:00  |   \_ supervise php-fpm
root      2630  0.0  0.0   3744   388 ?        S    15:18   0:00  |   \_ supervise log
root      2617  0.0  0.0   3732   296 ?        S    15:18   0:00  \_ readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
root      4595  0.0  0.0  58316  1636 tty1     Ss   16:23   0:00 /bin/login --
root      4596  0.1  0.1  21104  3380 tty1     S    16:23   0:00  \_ -bash
root      4932  0.0  0.0  11252  1380 tty1     S+   16:30   0:00      \_ /bin/sh -x ./fpm-test.sh
root      4961  0.0  0.0  16936  1108 tty1     R+   16:30   0:00          \_ ps axfu
apache    4942  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4943  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4944  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4945  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www
apache    4946  0.0  0.1 127524  3336 ?        S    16:30   0:00 php-fpm: pool www

# tail /var/log/php-fpm/current
@400000004e95eadd2158eb2c [12-Oct-2011 16:30:27] NOTICE: fpm is running, pid 4939
@400000004e95eadd216d4dec [12-Oct-2011 16:30:27] NOTICE: ready to handle connections
@400000004e95eae722524b04 [12-Oct-2011 16:30:37] NOTICE: fpm is running, pid 4950
@400000004e95eae722664c1c [12-Oct-2011 16:30:37] NOTICE: ready to handle connections
@400000004e95eaf1222a6814 [12-Oct-2011 16:30:47] NOTICE: Terminating ...

################################################################################
# php-fpm-test.sh
################################################################################
#! /bin/sh -x

php -v
php-fpm -v
grep -v '^;' /usr/local/etc/php/php-fpm.conf

echo -ne "---\n"
echo -ne "--- Step 1: Empty log.\n"
echo -ne "---\n"
> /var/log/php-fpm/current
ps axfu
tail /var/log/php-fpm/current
echo -ne "\n\n"

echo -ne "---\n"
echo -ne "--- Step 2: Start service.\n"
echo -ne "---\n"
svc -u /service/php-fpm/log /service/php-fpm
sleep 10
ps axfu
tail /var/log/php-fpm/current
echo -ne "\n\n"

echo -ne "---\n"
echo -ne "--- Step 3: Send service the HUP signal.\n"
echo -ne "---\n"
svc -h /service/php-fpm
sleep 10
ps axfu
tail /var/log/php-fpm/current
echo -ne "\n\n"

echo -ne "---\n"
echo -ne "--- Step 4: Stop service.\n"
echo -ne "---\n"
svc -d /service/php-fpm /service/php-fpm/log
sleep 10
ps axfu
tail /var/log/php-fpm/current
echo -ne "\n\n"
 [2011-10-12 20:08 UTC] fat@php.net
thx

It seems enough for me for now. I should be able to reproduce the problem on my 
side.

I'll let you know. I don't have any ETA to give you yet as I'm quite busy those 
days.
 [2012-02-22 11:42 UTC] lekensteyn at gmail dot co
5.3.10 can still not handle HUP. Looking at sapi/fpm/fpm/fpm_signals.c, I cannot
see anything that handles HUP so it defaults to terminating the program.
 [2017-10-24 07:43 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: fat +Assigned To:
 [2021-12-11 22:01 UTC] bukka@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bukka
 [2021-12-11 22:01 UTC] bukka@php.net
This should be fixed in PHP 7.4 with various other signal problems. If you still see an issue there or in later PHP version, please comment here or preferably open a new bug in GitHub.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC