oerdnj / deb.sury.org

Public bugreports for anything ppa:ondrej/*
821 stars 27 forks source link

php-fpm doesn't start when pid path is set to /var/run/pidfile.pid #1333

Closed arkpoah closed 4 years ago

arkpoah commented 4 years ago

This bug is coming with last versions on Debian buster, I can't reproduce it on Debian jessie (both I can test). It appears between php7.2-fpm_7.2.27-1 and php7.2-fpm_7.2.27-5 versions, no issue with first one. I also reproduce it with php7.4-fpm_7.4.2-5 on buster.

In /etc/php/7.2/fpm/php-fpm.conf, pidfile needs to be set in /var/run/php/pidfile.pid, if it is set on /var/run/pidfile.pid, I get this error on fpm start :

systemd[1]: Starting The PHP 7.2 FastCGI Process Manager...
systemd[1]: php7.2-fpm.service: Can't open PID file /run/php/php7.2-fpm.pid (yet?) after start-post: No such file or directory
systemd[1]: php7.2-fpm.service: Start-post operation timed out. Stopping.
systemd[1]: php7.2-fpm.service: Failed with result 'timeout'.
systemd[1]: Failed to start The PHP 7.2 FastCGI Process Manager.

I see systemd service file has 2 new lines :

ExecStartPost=-update-alternatives --quiet --install /run/php/php-fpm.sock php-fpm.sock /run/php/php7.2-fpm.sock 72
ExecStopPost=-update-alternatives --quiet --remove php-fpm.sock /run/php/php7.2-fpm.sock

Tried to add them with php7.2-fpm_7.2.27-1 working version to test it, but systemd is not agree :/


systemd[1]: php7.2-fpm.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.`
oerdnj commented 4 years ago

You need to override PIDFile=/run/php/php7.2-fpm.pid in the service file with:

systemctl edit php7.2-fpm and adding:

[Service]
PIDFile=
PIDFile=/run/php/php7.2-fpm.pid
arkpoah commented 4 years ago

It works when I change PIDFile= with same path set in php-fpm.conf, /run/php7.2-fpm.pid for me. I did not need to do that before, it is bug for me.

Regards

cbstudiomx commented 8 months ago

systemctl stop php-fpm74.service

systemctl start php-fpm74.service

systemctl status -l php-fpm74.service

For me this fix the problem:

systemd[1]: Can't open PID file /opt/alt/php-fpm74/usr/var/run/php-fpm.pid (yet?) after reload: No suc...irectory