How to stop chkservd monitoring Apache PHP-FPM on a LiteSpeed server?
Hello,
Environment:
- cPanel & WHM: 11.110.0.136
- OS: CloudLinux 7.9 (Boris Yegorov)
- Web server: LiteSpeed (lshttpd.service active; PHP served via lsphp)
- alt-php-config 1-69.el7, CageFS 7.6.38
- Apache PHP-FPM: unused — 0 domains have it enabled (grep -rl "php_fpm: 1" /var/cpanel/userdata/ returns nothing)
Goal:
Stop the ~200/day "The service apache_php_fpm appears to be down" emails. The service is genuinely unused (LiteSpeed handles all PHP via lsphp), so I want to disable chkservd monitoring of apache_php_fpm.
The problem in detail:
chkservd runs /usr/local/cpanel/scripts/restartsrv_apache_php_fpm every 5 minutes. That script attempts to start every alt-php-FPM pool, but all pools are configured to bind to the same port:
# grep -rH "^listen " /opt/alt/php*/etc/php-fpm.d/
/opt/alt/php70/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php71/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php72/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php73/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php74/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php80/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php81/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php82/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
/opt/alt/php83/etc/php-fpm.d/www.conf:listen = 127.0.0.1:9000
Only one can bind; alt-php72/73 always fail:
Jul 16 17:03:35 ... php-fpm[26204]: ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)
Jul 16 17:03:35 ... php-fpm[26204]: ERROR: FPM initialization failed
chkservd then reports the service down and emails. Fail counter is over 1000:
[XID ...] The "Apache PHP-FPM alt-73" service is down.
[XID ...] The "Apache PHP-FPM alt-72" service is down.
The subprocess "/usr/local/cpanel/scripts/restartsrv_apache_php_fpm" reported error number 29 when it ended.
[fail count:1017] Restarting apache_php_fpm.... [notify:failed service:apache_php_fpm]
What I've tried:
1. The documented API to turn off monitoring fails:
# whmapi1 configureservice service=apache_php_fpm monitored=0
---
metadata:
command: configureservice
reason: Failed to disable monitoring for apache_php_fpm.
result: 0
version: 1
2. enabled=0 similarly rejected.
3. Disabling the systemd units is no help — they were already disabled, and chkservd systemctl starts them on every cycle regardless:
# systemctl is-enabled alt-php72-fpm alt-php73-fpm
disabled
disabled
(chkservd restarts them anyway → fail → email.)
4. apache_php_fpm is not listed in /etc/chkserv.d/chkservd.conf (only cpanel_php_fpm:1, httpd:1, etc.), yet it is still being monitored — it appears to be a default-monitored "core" service via the service definition file /etc/chkserv.d/apache_php_fpm.
5. whmapi1 servicestatus shows:
display_name: PHP-FPM service for Apache
enabled: 1
installed: 1
name: apache_php_fpm
running: 0
Questions:
1. What is the supported way to stop chkservd from monitoring apache_php_fpm when Apache PHP-FPM is unused (LiteSpeed is the web server)? Why does configureservice … monitored=0 return "Failed to disable monitoring"?
2. Is the all-pools-on-port-9000 layout expected from alt-php-config/CloudLinux on a LiteSpeed box, or is it a misconfiguration I should correct (e.g., unique port or unix socket per pool)?
3. Short of a fix, is there an officially supported way to silence just this monitor (e.g., a tweak flag, or a supported chkservd exclude that survives cPanel updates)?
What I don't want to do: manually edit/remove /etc/chkserv.d/apache_php_fpm or hard-edit chkservd.conf, since cPanel may overwrite those on update. I'm looking for the supported path.
Thanks!
-
Hey there! I'm doing some research on this and I'll let you know as soon as I have more details.
0 -
It turns out that this function doesn't seem to work even though it's noted https://api.docs.cpanel.net/specifications/whm.openapi/services/configureservice that the whmapi1 system should be able to handle that.
I've created case CPANEL-54933 to have our developers look into this to see why that isn't working.
So, to answer your specific questions:
1 - This currently doesn't seem to be possible as this is not the intended behavior
2 - This issue is specific to CloudLinux, and you can read more on that here: https://cloudlinux.zendesk.com/hc/en-us/articles/28829619789212-cPanel-port-9000-bind-conflict-across-alt-phpXX-FPM-Email-alerts-The-apache-php-fpm-service-appears-to-be-down
3 - I don't have an officially supported method at this time, no. I'd recommend manual adjustment of those monitoring scripts you mentioned even though they will get overwritten in the future. You could also potentially create an email filter on your client for the time being to just ignore those messages.
0
Please sign in to leave a comment.
Comments
2 comments