Skip to main content

How to stop chkservd monitoring Apache PHP-FPM on a LiteSpeed server?

Comments

3 comments

  • cPRex Jurassic Moderator

    Hey there!  I'm doing some research on this and I'll let you know as soon as I have more details.

    0
  • cPRex Jurassic Moderator

    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
  • spaceman

    We hit this exact issue on a LiteSpeed/CloudLinux server - same symptoms, same rejected configureservice call. Two findings after digging through the cPanel code:

    1. Monitoring can't be disabled - it's hard-coded. Cpanel::Chkservd::Manage::get_always_monitored() returns a fixed list (cpsrvdqueueprocddnsadminapache_php_fpmcpanellogd) that chkservd always monitors. Even if apache_php_fpm:0 is saved in /etc/chkserv.d/chkservd.conf, it's ignored. So there's no supported way to silence the monitor - but you can fix why it fails.

    2. The real cause is likely stale domain pool files. The check requires a running FPM master for every PHP version that has at least one *.conf in /opt/cpanel/alt-phpXX/root/etc/php-fpm.d/ (note: not /opt/alt/phpXX/etc/php-fpm.d/ - different directory). Ours had orphaned pool files left over from when Apache PHP-FPM was briefly enabled for a domain and later disabled - cPanel didn't clean them up, and grep -rl "php_fpm: 1" /var/cpanel/userdata/ was empty for us too. Since chkservd keeps restarting alt-php72/73 on your box, check those two pool directories.

    The port 9000 collision is just the stock CloudLinux www.conf default - harmless until chkservd tries to start two alt-PHP FPM services at once, then only one can bind and the rest fail forever. No need to re-port anything.

    Fix: confirm nothing references the pools (no fcgi:// refs in vhost config, no connections to 127.0.0.1:9000), then back up and remove the stale pool files and stop the FPM service chkservd spawned:

    cp -a /opt/cpanel/alt-php72/root/etc/php-fpm.d/DOMAIN.conf /root/backup/
    rm /opt/cpanel/alt-php72/root/etc/php-fpm.d/DOMAIN.conf # repeat per version
    systemctl stop alt-php72-fpm
    /usr/local/cpanel/scripts/restartsrv_apache_php_fpm --check

    With no pool files present, the check passes with nothing to assert. Our next chkservd cycle logged notify:recovered and the alerts stopped after a month of failures every 5-10 minutes. Rollback is just copying the files back.

    0

Please sign in to leave a comment.