Nov 3, 2018
9
1
3
Netherlands
cPanel Access Level
Root Administrator
I'm running into an issue where every couple of days, the cpanel service is suddenly down.

I generally notice this when checking my own email, because imap/exim go down with the cpanel service while apache does not, so I can still visit websites hosted on the server.

I then connect to the server, run "service cpanel status" and get something like this:

Code:
[[email protected] ~]# service cpanel status
Redirecting to /bin/systemctl status cpanel.service
● cpanel.service - cPanel services
   Loaded: loaded (/etc/systemd/system/cpanel.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Fri 2019-07-05 00:23:34 CEST; 11min ago
  Process: 28785 ExecStop=/usr/local/cpanel/scripts/restartsrv_cpsrvd --no-verbose --stop --notconfigured-ok --systemd-service=cpanel (code=exited, status=0/SUCCESS)
 Main PID: 28670 (code=killed, signal=TERM)

Jul 03 23:42:29 web1.[...] systemd[1]: Starting cPanel services...
Jul 03 23:42:29 web1.[...] restartsrv_cpsrvd[28654]: License is vali...
Jul 03 23:42:29 web1.[...] restartsrv_cpsrvd[28654]: Starting PID 28...
Jul 03 23:42:29 web1.[...] systemd[1]: Started cPanel services.
Jul 05 00:23:34 web1.[...] systemd[1]: Stopping cPanel services...
Jul 05 00:23:34 web1.[...] restartsrv_cpsrvd[28785]: Gracefully term...
Jul 05 00:23:34 web1.[...] restartsrv_cpsrvd[28785]: Gracefully term...
Jul 05 00:23:34 web1.[...] restartsrv_cpsrvd[28785]: Gracefully term...
Jul 05 00:23:34 web1.[...] restartsrv_cpsrvd[28785]: Waiting for 287...
Jul 05 00:23:34 web1.[...] systemd[1]: Stopped cPanel services.
I then run "service cpanel start" to get it back up.

The cpanel service going down is a problem for me. In particular is it a problem that imap/exim go down, because one of my websites really needs email functionality for customers. (Among other things, it's used to verify the email accounts of new users.)

My question is: what would be the best steps to investigate what is causing cpanel (and imap/exim) to be killed?

I do occasionally have high CPU load processes running (including ffmpeg), but I don't think this is what is causing the problem, because I think the services also go down when it's quiet on the server.

Thanks.
 

darklord1

Well-Known Member
Jul 8, 2006
58
0
156
cPanel Access Level
Root Administrator
Hi,

First bit of advice is to utilize a monitoring service from a 3rd party like pingdom or something of that nature to help determine if the shutdown occurs on a standard interval or not.

Also, check out the logs in /var/log/ (anywhere). There may be some information here.

High CPU would not be the likely cause of exim shutting down, so I would think there was something else going on. Disk usage hitting 100% will lock the services up and they would appear down.

Make sure you do a `ps aux` and see if cPanel/exim/imap is running before thinking they are 100% down.

Incase it's something silly, like a backup or process running, check all your cron jobs to make sure nothing is running when things go down.

Truth is, there are a lot more complex and efficient ways of determining this. I only offer the advice the way I do because it fits every user of every technical level.

- Removed -
 
Last edited by a moderator:

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
6,762
535
263
Houston
cPanel Access Level
DataCenter Provider
I also want to point out that this shouldn't be occurring on a routine basis, I'd second the advice provided by @darklord1 here - /var/log/mesages may be extremely helpful to identify which if any services are being killed (based on the error message it would appear cpsrvd is being killed)

You might also check some system statistics using sysstat which can be helpful in identifying resource usage issues.

This will get you the memory usage since 12am
Code:
sar -r
This will get you the CPU usage since 12am
Code:
 sar -p
You can also view historical usage by pointing to the file directly at /var/log/sa/saXX where XX = the day of the month. For example if I wanted yesterday's memory stats I would run:

Code:
sar -r -f /var/log/sa/sa07
If I wanted the CPU usage from the first I would run:

Code:
sar -f /var/log/sa/sa01