[BlueOnyx:25808] 5211R: system php update - admserv fails on php-fpm restart
Juerg Sommer
jsommer at emailto.ch
Sat Dec 10 14:38:17 -05 2022
Hi Michael
Today I have updated my system php from 8.0 to 8.1:
dnf module reset php
dnf module enable php:8.1
dnf update php mariadb
Everything works fine and my virtual hosts have now php 8.1. The admserv
php in /home/solarspeed/admserv-php was untouched and also worked.
Great, updating system php was earlier much more difficult.
But I have an problem: every stop (or restart) removes the
/var/run/php-fpm directory (and creates it again on start). In
/usr/lib/systemd/system/php-fpm.service with php 8.0 there is:
PIDFile=/run/php-fpm/php-fpm.pid
and with the new file with php 8.1, there's a RuntimeDirectory declared,
which will be removed on service stop:
RuntimeDirectory=php-fpm
RuntimeDirectoryMode=0755
In this directory are also the files for admserv-php-fpm:
admserv-fpm.sock and admserv-php-fpm.pid. This files will also removed
on stop of php-fpm and admserv doesn't work until I restart the
admserv-php-fpm service.
So I have to patch the /usr/lib/systemd/system/php-fpm.service and
remove the RuntimeDirectory setting and setting the PIDFile as it is in
php 8.0. Another possibility is to change the admserv-php-fpm to store
the sock and pid-file in /var/run/admserv-php-ftp, but then I need to
patch four files:
- /usr/lib/systemd/system/admserv-php-fpm.service
- /etc/admserv/php-fpm/php-fpm.conf
- /etc/admserv/php-fpm/pools/admserv.conf
- /etc/admserv/conf/httpd.conf
In both cases everything works fine and the services admserv-php-fpm and
php-fpm are independent and I can start/stop this services with any
impact to the other service. But patched files will maybe updated by
yum, so it's not perfect and other users maybe would also update php.
What's the reason to store the admserv-php-fpm sock- and pid-file in
/var/run/php-fpm? I think move them to /var/run/admserv-php-fpm would
make sense. What do you think about?
Regards,
Juerg
More information about the Blueonyx
mailing list