Restarting a cPanel service is routine, but on a busy server “restart” is not free — some restarts are graceful and invisible, others drop live connections, and a few (the database, the management daemon) carry real risk if you treat them like flipping a light switch. The right tool is cPanel’s own restartsrv_* family and the WHM Restart Services menu, which know how each daemon should be started under cPanel. Knowing which restart costs what, and checking the service is actually back, is the difference between a clean fix and a self-inflicted outage.
What’s happening
cPanel manages its services through wrapper scripts under /scripts/ named restartsrv_<service> (Apache is restartsrv_httpd, Exim is restartsrv_exim, and so on). These are not the same as raw systemctl restart — they apply cPanel’s configuration, run the service’s own validation where applicable, and update cPanel’s service-monitoring state so chkservd (the service monitor) does not immediately flag the service or fight your restart. WHM’s Restart Services menu and the Service Manager are the UI over the same machinery.
The cost of a restart varies by service. Apache/LiteSpeed support a graceful reload that finishes in-flight requests before swapping config — connections are not dropped. Exim and Dovecot restart quickly and only briefly interrupt new SMTP/IMAP connections; queued mail is not lost. MySQL/MariaDB is the expensive one: a restart drops every open database connection, can take time to flush and recover on a large dataset, and stalls every site that talks to it until it is back. cpsrvd restarts only the WHM/cPanel interface — websites and mail are unaffected — which is why it is the safe one to bounce when WHM misbehaves. Restarting the wrong service with the wrong method (e.g. a hard MySQL restart at peak) is how a small fix becomes a visible outage.
How to verify
Check a service’s status before and after, using cPanel’s own status command:
# Status via cPanel's wrapper (knows the cPanel-managed state)
/scripts/restartsrv_httpd --status
/scripts/restartsrv_exim --status
/scripts/restartsrv_mysql --status
/scripts/restartsrv_cpsrvd --status
See what chkservd monitors and its current view, so you do not fight the monitor:
# chkservd's monitored services and last check
tail -40 /var/log/chkservd.log
cat /etc/chkserv.d/chkservd.conf
Confirm the service is actually listening after a restart, not just “started”:
# Ports back up? (web 80/443, mail 25/143/993, db 3306, WHM 2087)
ss -lntp | grep -E ':80|:443|:25|:143|:993|:3306|:2087'
The fix / steps
- Use restartsrv / Restart Services, not raw systemctl. Restart through
/scripts/restartsrv_<service>or WHM » Restart Services. These apply cPanel’s config and keep chkservd in sync; a baresystemctl restart httpdcan leave cPanel’s monitoring out of step and may be reverted or re-flagged. Let cPanel restart cPanel’s services. - Prefer a graceful reload for the web server. For Apache or LiteSpeed config changes, reload gracefully so in-flight requests complete and no visitor sees a dropped connection. Reserve a full restart for cases where graceful is not enough (a worker wedged, a module change that requires it). Validate the config before restarting so you do not restart into a broken state.
- Treat MySQL/MariaDB restarts as a planned event. A database restart drops all connections and can take real time to recover on a large dataset, stalling every site meanwhile. Do it during a quiet window, warn anyone watching, and have a reason — most “just restart MySQL” instincts are better served by finding the actual query or lock causing the problem.
- Bounce cpsrvd freely when WHM/cPanel misbehaves.
/scripts/restartsrv_cpsrvdrestarts only the management interface; websites and mail keep serving. This is the safe restart for a blank WHM or a stuck cPanel UI and can be run any time without customer impact. - Restart mail services knowing the interruption is brief.
/scripts/restartsrv_eximand/scripts/restartsrv_dovecotonly momentarily interrupt new connections; in-flight and queued mail survive. Use them after Exim/Dovecot config changes or to clear a wedged mail daemon, then send a test to confirm delivery resumed. - Let chkservd handle routine flaps, and read it before forcing restarts. chkservd already restarts a service it finds down. If a service keeps “needing” restarts, the answer is in
/var/log/chkservd.logand the service’s own log — a crash loop, an OOM kill, a config error — not in restarting it harder. Diagnose the recurrence rather than scripting a restart over it. - Verify it actually came back, do not assume. After any restart, run
--statusand confirm the port is listening (ss -lntp). A service can report “started” while failing to bind (a config error, a port conflict). The listening check is what proves the restart worked, especially for Apache and Exim. - For multiple services, restart in dependency order. If you must restart several, bring the database back first, then the web server that depends on it, then the mail and interface daemons. Restarting a web server while its database is still down just serves errors. Order the bounces so each service has what it needs when it comes up.
A restart is a tool with a known cost per service — graceful for web, brief for mail, expensive for the database, safe for cpsrvd — and the verification step is what keeps a fix from becoming an outage. Stack Harbor manages cPanel service health and restarts under cPanel server management — start a conversation when services keep needing a kick.