Working on a fresh installed Centos server with CPanel (stable release 10.8.2-S120) on it, I have noticed that it didn’t had chkservd running. chkservd is a little CPanel utility that allows you to check from WHM what applications it will monitor, and in case there is a problem with any of those services it will restart it and send a notification to the administrative account. There are other open source projects to achieve the same thing, but I wanted to have this running on Centos as on any other CPanel server (as it integrates very nice in WHM, etc.) because if was much simpler for the client to manage this himself later.
If for some reason chkservd was not installed during the initial installation process of CPanel we can reinstall it later by running:
But running this on this Centos system has given me an error (as it has probably given at install time the same):
Unable to locate chkservd init script for OS CentOS 4.3
Hmm… Strange… I know for sure that I have this running on other CPanel servers with Centos 4.3… Well anyway it seems that the install script is checking the OS installed. A quick look inside the script will show us that this is done using some internal CPanel function:
$os = Cpanel::cPanelFunctions::getos();
The easiest solution I have found to solve this, without trying to change internal CPanel scripts, was to make it think that this is one of the supported systems. And since Centos4, is basically RHEL4, I had changed the distribution banner to RHEL, like this:
/etc/redhat-release CentOS release 4.3 (Final)
from: “CentOS release 4.3 (Final)” to “Red Hat Enterprise Linux ES release 4 (Nahant Update 3)”
After this change, the install script ran without any error and installed chkservd properly and it started it ok. Now I have changed back the banner to the original one.
I assume that this could have been done also by copying the init scripts from redhat (as this was used after all by the install):
and named them chkservd.init.centos…
After this chkservd is running just fine on this Centos server and it can be configured from WHM (Service Configuration >> Service Manager) as on any other CPanel system.