cpsrvd is the cPanel service daemon: one Perl process that answers every cPanel web port on the server. That means cPanel on ports 2082 and 2083, WHM on 2086 and 2087, and webmail on 2095 and 2096. No separate web server sits behind those ports, so when cpsrvd is down all six stop at the same moment, and nothing else on the server notices. Two independent supervisors bring it back: the systemd unit cpanel.service, and chkservd, the service monitor that runs inside cPanel’s tailwatchd process. Because of that double supervision, the usual cpsrvd complaint is not “it is stopped” but “it will not stay up”. In a restart loop, the daemon dies partway through starting, gets relaunched a few seconds later, and dies at the same step, while systemctl status cpanel looks healthy each time you check. The reason is never in the systemd journal. cpsrvd writes it to /usr/local/cpanel/logs/error_log just before it exits, and that one line is the whole diagnosis.
What you’ll accomplish
- Know what cpsrvd serves, on which ports, and what a user actually sees when it is down.
- Check its status and restart it deliberately, understanding what a restart costs the people already logged in.
- Tell a crash apart from a deliberate restart and from a monitoring-triggered restart, using the logs.
- Confirm a restart loop and find the one log line that names the real initialization failure.
- Work through the five causes that actually produce a loop, and recognize the case where a restore beats a repair.
Prerequisites
- Root SSH access to the cPanel server, or serial/KVM console access if SSH is also affected.
- cPanel & WHM v110 or newer on an RHEL-family OS (AlmaLinux, Rocky, or CloudLinux) managed by systemd. Older v11.x builds behave the same way; only the exact log wording drifts.
ss,curl,df, andjournalctlavailable on the host.- A current backup or hypervisor snapshot before you edit
/var/cpanel/cpanel.config.
One note on paths. cPanel’s maintenance scripts live in /usr/local/cpanel/scripts/, and /scripts is a symlink to that directory kept for compatibility with a decade of older runbooks. Both work today, but the symlink has been described as legacy for several major versions, and it is the first thing to go missing in a broken or partially restored install. Every command below uses the full path, so it keeps working when the shortcut does not.
If WHM itself is unreachable, nothing here depends on it. Every step runs from a shell. If WHM answers intermittently, treat that as evidence of a loop rather than an opening to click through Tweak Settings — a page load that lands between two restarts will happily save a half-written config.
How it works
Think of cpsrvd as a small web server that cPanel wrote for itself. It listens on six TCP ports, decides which interface a request belongs to based on the port it arrived on, authenticates the user, and forks a worker to handle the request. The plain-text ports (2082, 2086, 2095) redirect to their TLS twins on any current install. Because a single process owns all six sockets, port symptoms are a useful signal in themselves: if webmail fails but WHM answers, cpsrvd is running and your problem is elsewhere — a mail service, a proxy rule, a per-service SSL certificate. Only a simultaneous failure across all six points at the daemon.
Two mechanisms restart it, and they do not coordinate. The systemd unit cpanel.service wraps the daemon and carries a Restart= directive, so systemd relaunches the process whenever it exits. Separately, chkservd polls every service listed in /etc/chkserv.d/chkservd.conf on a timer, and when it finds one down it calls the matching restartsrv_* script. cpsrvd is monitored by default. Both mechanisms are doing exactly what they were built to do; neither knows the difference between a process that crashed once and a process that will crash identically every time it starts.
That non-coordination is the source of most confusion during an incident. You stop cpsrvd to inspect a port, and it is running again before you finish typing the next command — not because your stop failed, but because chkservd’s next poll landed in between. Read that as the monitor working, not as the daemon refusing to die.
Three logs let you tell the three cases apart, and reading them in the right order saves an hour:
/usr/local/cpanel/logs/error_logis cpsrvd’s own log. A crash writes adieorwarnline here with the exception text, seconds before the process disappears. This is the only place the actual reason appears./var/log/chkservd.logrecords each monitoring pass and each restart chkservd triggers. A restart with a matching entry here was monitoring-driven, which means the daemon had already stopped for some other reason.journalctl -u cpanelrecords the systemd view: start, exit, exit code, restart. Nothing about why. A clean stop you performed yourself appears here with no accompanying error-log entry and no chkservd entry — that is what a deliberate restart looks like, and it is the fingerprint you compare everything else against.
cpsrvd’s startup runs in a fixed order: read the config, load its Perl modules, check the license, bind the listening sockets, then fork workers. A failure at any step before the fork kills the parent. The supervisor restarts it, the same failure recurs at the same step, and you have a loop.
Step-by-step
-
Ask cPanel for the daemon’s state, not just systemd. The
restartsrv_*scripts report what cPanel believes, which is not always what systemd believes — a disagreement between the two is itself a finding./usr/local/cpanel/scripts/restartsrv_cpsrvd --statusA healthy answer names the running PID:
cpsrvd (/usr/local/cpanel/cpsrvd - version 11.126) is running as root with PID 21884 (systemd+/proc check method).If this reports the service down while
systemctl status cpanelreports it active, you are almost certainly looking at a loop caught mid-cycle. -
Restart it deliberately, and know what that costs. A restart drops every request in flight. Session cookies survive — sessions are stored on disk — so users are not logged out, but anything running inside a request dies with the worker: a File Manager upload, an archive extraction, a browser-based Terminal session in cPanel or WHM. Restart during a quiet window if you have the choice.
/usr/local/cpanel/scripts/restartsrv_cpsrvd --restartWaiting for cpsrvd to restart......finished. cpsrvd (/usr/local/cpanel/cpsrvd - version 11.126) is running as root with PID 24019 (systemd+/proc check method).Prefer this over
systemctl restart cpanel. The script coordinates with cPanel’s own service manager, so chkservd does not treat the gap as an outage and fire a second restart on top of yours. For the wider picture of which cPanel services tolerate a restart and which do not, see restarting cPanel services safely. -
Confirm it is a loop, not a stop. Run the status command twice, about twenty seconds apart, and compare the uptime.
systemctl status cpanel --no-pagerA looping daemon shows a start time that keeps resetting:
● cpanel.service - cPanel Loaded: loaded (/usr/lib/systemd/system/cpanel.service; enabled) Active: active (running) since Sat 2026-08-08 14:22:41 UTC; 7s agoSeven seconds, then nine seconds, then four. If the second run reports minutes of uptime, cpsrvd is stable and your problem is elsewhere — a firewall rule, a proxy, or whostmgrd rather than cpsrvd.
-
Read the cPanel error log before anything else. This is where the actual exception lands. The journal only records that the process died.
tail -n 100 /usr/local/cpanel/logs/error_logYou are looking for a line written seconds before each restart. A config failure reads like this:
[2026-08-08 14:22:39 +0000] warn [cpsrvd] Unable to parse line 118 of /var/cpanel/cpanel.configA missing module reads like this:
[2026-08-08 14:22:39 +0000] die [cpsrvd] Can't locate Cpanel/Config/LoadCpConf.pm in @INCWhatever phrase appears here decides everything that follows. If the log is silent, the process is being killed rather than failing — jump to step 10.
-
Separate a crash from a monitoring restart. Line the two logs up in time. If
/var/log/chkservd.logshows a restart with no preceding error-log entry, cpsrvd was found down rather than observed dying, and something outside the daemon is stopping it.tail -n 40 /var/log/chkservd.log grep -Ei 'cpsrvd|oom|killed process' /var/log/messages | tail -n 30Aug 8 14:22:38 web01 kernel: Out of memory: Killed process 21884 (cpsrvd)The OOM killer is the usual answer to “no error log entry, daemon keeps vanishing”. Confirm the monitor is alive while you are here:
/usr/local/cpanel/scripts/restartsrv_tailwatchd --status -
Check for a port conflict on 2087 and 2083. If something else already owns the socket, cpsrvd cannot bind and exits.
ss -ltnp | grep -E ':(2082|2083|2086|2087)'Normal output shows one cpsrvd process owning all of them:
LISTEN 0 128 0.0.0.0:2087 0.0.0.0:* users:(("cpsrvd",pid=21884,fd=6)) LISTEN 0 128 0.0.0.0:2083 0.0.0.0:* users:(("cpsrvd",pid=21884,fd=7))Two different PIDs, or a non-cpsrvd process name, is your answer. Stop the service cleanly before killing anything, so the supervisor does not race you:
/usr/local/cpanel/scripts/restartsrv_cpsrvd --stop ss -ltnp | grep ':2087'If a listener survives the stop, that PID is the orphan.
-
Validate the config file.
/var/cpanel/cpanel.configis a flat list ofkey=valuelines. Anything not shaped that way is a parse error waiting to happen. Take a copy first.cp -a /var/cpanel/cpanel.config /root/cpanel.config.$(date +%F) grep -nEv '^[A-Za-z0-9_.-]+=' /var/cpanel/cpanel.configClean output is empty. A truncated write — the classic result of a full disk during a Tweak Settings save — prints the damage:
118:skipboxtrapperFix the flagged line by giving it a value or removing it, then restart. Once WHM is reachable again, re-apply anything you removed through Tweak Settings, or from the shell with the WHM API:
/usr/local/cpanel/bin/whmapi1 set_tweaksetting key=skipboxtrapper value=1Keeping a written record of who changed what in this file turns the next incident into a five-minute job; a Tweak Settings change log covers how.
-
Rule out a half-finished upgrade. An
upcprun interrupted by a reboot, an OOM kill, or a lost SSH session leaves the Perl tree inconsistent. Check when the last update ran, then repair the package set.ls -lt /var/cpanel/updatelogs/ | head -n 5 /usr/local/cpanel/scripts/check_cpanel_pkgs --fixChecking cPanel RPMs... [100%] Done Problems were detected with cPanel-provided files which are RPM controlled. Reinstalling: cpanel-perl-536-Cpanel-ConfigIf the error log named a missing
Cpanel::*module specifically, rebuild the Perl environment as well, then re-sync the release files:/usr/local/cpanel/scripts/fix-cpanel-perl /usr/local/cpanel/scripts/upcp --sync-only--sync-onlyrefreshes cPanel’s own files without running a full version upgrade — which is what you want mid-incident, since a fullupcpon a broken host is a much larger change than the one you are trying to make. -
Check the license. An expired or unverifiable license stops cpsrvd from serving, and on some builds stops it from staying up at all.
/usr/local/cpanel/cpkeycltSuccess is unambiguous:
Updating cPanel license...Done. Update succeeded. Building global cache for cpanel...DoneA failure here is its own problem rather than a cpsrvd problem — outbound 443 to the license servers is the usual culprit. The full diagnostic path is in cPanel license troubleshooting.
-
Check disk and inodes. A filesystem with no free space or no free inodes breaks cpsrvd in a way that produces almost no useful log output, because the daemon cannot write its own log either.
df -h / /usr /var df -i / /usr /varFilesystem Size Used Avail Use% Mounted on /dev/vda1 40G 40G 0 100% / Filesystem Inodes IUsed IFree IUse% Mounted on /dev/vda1 2621440 2621440 0 100% /Either column at 100% is the root cause and nothing else you do will hold. Reclaim space before restarting — old update logs under
/var/cpanel/updatelogs/, rotated logs in/usr/local/cpanel/logs/, and stale backups under/homeare the usual candidates.
Validate it works
A restart that succeeds once proves nothing — the loop always succeeds once. Verify across a window instead.
Start the daemon and record its PID:
/usr/local/cpanel/scripts/restartsrv_cpsrvd --restart
/usr/local/cpanel/scripts/restartsrv_cpsrvd --status
Wait five minutes, then confirm the PID has not changed and systemd agrees on the uptime:
systemctl status cpanel --no-pager | grep -E 'Active|Main PID'
Active: active (running) since Sat 2026-08-08 14:41:02 UTC; 5min 12s ago
Main PID: 24019 (cpsrvd)
Confirm the ports are bound by that same PID:
ss -ltnp | grep -E ':(2082|2083|2086|2087|2095|2096)' | wc -l
Six listeners is the expected count on a standard install with plain-text ports enabled; four if they are disabled. Finally, make a real request against WHM’s TLS port from the host itself, which takes the network and any firewall out of the picture:
curl -skI https://127.0.0.1:2087/
HTTP/1.1 301 Moved Permanently
Location: https://127.0.0.1:2087/login/
Any HTTP status line means cpsrvd accepted the connection and answered. A Connection refused means it is not listening; a hang means it bound the socket but never forked workers, which sends you back to step 4 with a fresh log tail. Repeat the same curl against 2083 and 2096 — a daemon that answers on one port and not another has bound partially, which is a different fault from a loop and worth its own log read.
Troubleshooting
The daemon restarts itself seconds after you stop it. That is chkservd doing its job, not a failed stop. Confirm it in /var/log/chkservd.log, and if you need a genuinely quiet window for maintenance, unmonitor the service first rather than fighting it — /usr/local/cpanel/bin/whmapi1 configureservice service=cpsrvd enabled=1 monitored=0 — and set monitored=1 again the moment you are finished. Leaving cpsrvd unmonitored is worse than the problem you were solving.
The license is valid but cpkeyclt still fails. The server cannot reach the license servers on outbound 443. Check egress filtering and any upstream firewall, and confirm the server’s public IP matches the licensed IP — a migration to a new IP invalidates the license instantly, and the daemon fails long before anyone notices the address changed.
Port 2087 is held after the service is stopped. A cpsrvd parent killed with SIGKILL can leave a worker holding the socket. Find the owner with ss -ltnp | grep ':2087', confirm it with ps -fp <pid>, and terminate it with kill <pid> — plain SIGTERM first. Only escalate to kill -9 if the process ignores it, and re-check the port before starting cpsrvd again, because starting into an occupied port simply restarts the loop.
cpanel.config was rewritten as an empty or truncated file. This is what a disk-full event during a settings save leaves behind. Restore your copy from step 7, or from the most recent backup of /var/cpanel/. Do not guess at the missing keys — cPanel repopulates any key it does not find with its default, so a smaller-but-valid file boots and lets you re-apply settings deliberately afterwards.
The loop returns hours after a clean fix. Something is re-breaking the host on a schedule. Look for a cron job or a monitoring agent that writes into /var/cpanel/, and check whether disk usage is climbing back toward full. A loop that comes and goes with disk usage is a capacity problem wearing a daemon’s clothes.
When this is the wrong approach
Stop repairing and start restoring when the evidence points past cpsrvd. Repeated I/O errors in dmesg, a root filesystem that remounts read-only, or package installs failing on checksum mismatches all say the storage under the server is failing — reinstalling Perl modules onto a bad disk wastes the hours you need for a migration. The same applies after a failed OS major-version upgrade: if AlmaLinux 8 to 9 stopped halfway, cPanel is running against a package set it was never built for, and cPanel’s own guidance is to restore rather than repair in place. In both cases, provision a clean host, restore accounts from your most recent verified backup, and cut DNS over. That path has a predictable duration; an open-ended repair on a damaged host does not.
The other wrong turn is smaller and more common: treating a single-interface failure as a cpsrvd problem. If cPanel answers on 2083 but webmail throws an error on 2096, cpsrvd is fine and the fault is downstream in the mail stack — start from webmail not loading instead of restarting the daemon and hoping.
For the supported upgrade and recovery procedures, cPanel’s own product documentation is the reference to work from.
If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.