问题描述
今天修改了一个 php-fpm.conf 的配置:daemonize = yes。
然后使用 kill -USR2 'cat /usr/local/var/run/php-fpm.pid' 重启 php-fpm.
执行 ps -ef | grep php-fpm 的结果如下图:
501 25131 1 0 9:31下午 ?? 0:00.37 /usr/local/opt/php/sbin/php-fpm --nodaemonize
501 25136 25131 0 9:31下午 ?? 0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
501 25137 25131 0 9:31下午 ?? 0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
然后通过 kill -9 25131,这个 pid 的进程停止了又会自动启动一个新的 fpm 进程。
我的问题是,为什么 fpm 会自动重启,还有 --nodaemonize 是什么,我的进程里没有发现 master process .
下面是我关闭进程后的日志:
[27-Sep-2018 09:44:17] NOTICE: Finishing ...
[27-Sep-2018 09:44:17] NOTICE: exiting, bye-bye!
[27-Sep-2018 09:44:17] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[27-Sep-2018 09:44:17] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[27-Sep-2018 09:44:17] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[27-Sep-2018 09:44:17] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[27-Sep-2018 09:44:17] NOTICE: fpm is running, pid 941
[27-Sep-2018 09:44:17] NOTICE: ready to handle connections