SOLVED [CPANEL-25364] Disabled services show failed by systemd on boot

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
702
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
CentOS Linux release 7.6.1810 (Core)
cPanel 76.0 (build 18)

On boot systemd will show the following

[FAILED] Failed to start cPanel Greylisting Daemon.
See 'systemctl status cpgreylistd.service' for details.
[FAILED] Failed to start FPM service for cPanel Daemons.
See 'systemctl status cpanel_php_fpm.service' for details.

Both of those services are disabled in the WHM and systemd by default.

/etc/systemd/system/cpanel.service has a "Wants" asking for cpanel_php_fpm.service and cpgreylistd.service so on boot systemd is attempting to start those services. Since both of those services are set to disabled in the WHM they will return a disabled message and a exit code that will cause systemd to show failed.

Solution, Remove cpanel_php_fpm.service and cpgreylistd.service from the "Wants" in cpanel.service. These two services should be controlled by systemd and enabled/disabled in systemd when the admin wants to use or not use the service.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,274
1,295
313
Houston
Hi @shaun


While I do see that you've resolved this I am curious to know, how did you disable these services initially? If you had disabled them in WHM this should not be occurring.
 

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
702
1
318
San Clemente, Ca
cPanel Access Level
DataCenter Provider
Twitter
On a new cPanel install both of those services are disabled by default within systemd and in the service manager. The issue is that /etc/systemd/system/cpanel.service has a "Wants" for both of those services which causes systemd to attempt to start them when the cpanel service starts. I've pasted the contents of /etc/systemd/system/cpanel.service below so you can see what i'm referring to.

Code:
[Unit]
Description=cPanel services
After=network.target network-online.target
Wants=cpanelquotaonboot.service cpanellogd.service cpdavd.service cpanel_php_fpm.service cpgreylistd.service cphulkd.service dnsadmin.service mailman.service p0f.service smtpmailgidonly.service queueprocd.service tailwatchd.service network-online.target
ConditionPathExists=!/etc/cpsrvddisable

[Service]
Type=forking
PIDFile=/var/run/cpsrvd.pid
ExecStart=/usr/local/cpanel/scripts/restartsrv_cpsrvd --no-verbose --notconfigured-ok
ExecStop=/usr/local/cpanel/scripts/restartsrv_cpsrvd --no-verbose --stop --notconfigured-ok
KillMode=process
TimeoutStopSec=10

[Install]
WantedBy=multi-user.target
This service file should probably be re-evaluated. It's asking for services like cphulkd, mailman, p0f, smtpmailgidonly and a few others that are not needed to actually run cpsrvd. I was going to start another thread about mailman but since cpanel.service is also asking for mailman it's also attempted to be started and if there are no mailing lists present the service again will show failed.

Some of these "Wants" should probably be moved into "After"
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,274
1,295
313
Houston
Hi @shaun


That's a great point, I'm able to replicate the behavior as well. Thanks for following up! As a result of this, I've opened CPANEL-25364 - Disabled services show as failed to start on boot


I'll let you know the status of this case as soon as I have more information on it or any updates.


Thanks!
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,457
1,965
363
cPanel Access Level
Root Administrator
@Brian N - I reached out to our team about this issue just now. The short story is that fixing this issue would require a complete reconfiguration of how cPanel integrates with systemd, and it's just not something our team plans to do at this time. It's also important to note that this thread is the only complaint we've received on this issue so far.

The good news, is that as cPanel changes and the systemd integration gets improved, this will likely get fixed as a byproduct of that work. At this time, however, the developers aren't able to specifically fix just this one issue.