Topic: PHP-FPM 5.6 Fails to start after reboot on CentOS 7
Hi
I noticed today that PHP-FPM 5.6 packages fail to startup after a reboot on CentOS 7 because the /run/php-fpm directory does not exist.
Checking the service file in /usr/lib/systemd/system/php-fpm.service I can see that RuntimeDirectory is missing. This statement exists in the PHP-FPM 7.2 packages but not the 5.6 packages. It means after a reboot, because /run is tmpfs, the php-fpm subfolder does not exist and the service fails to start.
Here is the 5.6 service file:
# It's not recommended to modify this file in-place, because it
# will be overwritten during upgrades. If you want to customize,
# the best way is to use the "systemctl edit" command.
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/php-fpm
ExecStart=/usr/sbin/php-fpm --nodaemonize
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
The PHP-FPM 7 service file is this and this one works after reboot:
# It's not recommended to modify this file in-place, because it
# will be overwritten during upgrades. If you want to customize,
# the best way is to use the "systemctl edit" command.
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/php-fpm
ExecStart=/usr/sbin/php-fpm --nodaemonize
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true
RuntimeDirectory=php-fpm
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
Is this something that would be able to be fixed in an updated package? No specific rush as we can work around it for now.
Thanks!