php-fpm process does no longer show version

Freddy

Verified User
Joined
Apr 14, 2016
Messages
125
After updating PHP from version 8.3.13 to 8.3.14 on a DirectAdmin 1.671 system the process list ps -A no longer shows a PHP version. I used this to check if all service are running correctly in my system monitoring system.

I did a check like this:
Code:
pgrep php-fpm83
And it would report the process id's. After the update this command does not show any processes. Instead, I should check PHP like this:
Code:
pgrep php-fpm

But this messes up my monitoring system since my checks are based upon the service file from DirectAdmin: /usr/local/directadmin/data/admin/services.status
And that says php-fpm83

Why did this minor update changed the PHP process?
 
We no longer annotate PHP version binaries with the release suffix, to stay closer to clean PHP installs. The names in inside the data/admin/services.status file does not match the binary names reported in the process list, for example - mariadb, clamav, even named on Debian systems.

I would recommend you to update your monitoring scripts to instead check for the service status reported by systemd. For example systemctl status php-fpm73. If you do not need detailed output you can check only the exit code of systemctl --quiet is-active php-fpm83.

Code:
# systemctl --quiet is-active php-fpm83.service && echo "yes it is running" || echo "no it is dead"
yes it is running
# systemctl --quiet is-active php-fpm99.service && echo "yes it is running" || echo "no it is dead"
no it is dead
 
We no longer annotate PHP version binaries with the release suffix, to stay closer to clean PHP installs. The names in inside the data/admin/services.status file does not match the binary names reported in the process list, for example - mariadb, clamav, even named on Debian systems.

I would recommend you to update your monitoring scripts to instead check for the service status reported by systemd. For example systemctl status php-fpm73. If you do not need detailed output you can check only the exit code of systemctl --quiet is-active php-fpm83.

Code:
# systemctl --quiet is-active php-fpm83.service && echo "yes it is running" || echo "no it is dead"
yes it is running
# systemctl --quiet is-active php-fpm99.service && echo "yes it is running" || echo "no it is dead"
no it is dead
Until this update all names inside services.status did match processes on my servers. I use MariaDB but the services file tells me the process is called mysqld.

But I do think your solution is more robust, so I will change my script to use systemctl.
 
Back
Top