Hi,
For some PHP application troubleshooting , we need to find out the detail what operation/action happens when we reload the php-fpm daemon by systemd
exceuting the command
systemctl reload php-fpm.service
[ktahir]$ systemctl status php-fpm.service
β php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2024-08-14 07:25:21 +04; 3h 52min ago
Process: 19394 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS)
its configuration file is located at /usr/lib/systemd/system/php-fpm.service
Signal Standard Action Comment
ββββββββββββββββββββββββββββββββββββββββ
SIGUSR2 P1990 Term User-defined signal 2
So you should refer to the source code of php.
I think you can start with fpm_signals.c.
I think it will wait for a while, but it could be very confusing if you reload php-fpm without taking the web server into account. I stop apache first, then stop php-fpm, then start in reverse order. Application design makes a difference; php makes sense for requests that run quickly and then finish, but some applications have long running php scripts that can cause all kinds of problems, e.g. phpmyadmin has a script to import a database that can run for ages.
Graceful reload means that the workers stop to accept new connections and finish their running tasks. Behind the scenes SIGQUIT is being sent to the workers.