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

shaun

Well-Known Member
PartnerNOC
Verifed Vendor
Nov 9, 2001
708
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
Staff member
Nov 14, 2017
13,296
1,271
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
708
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
Staff member
Nov 14, 2017
13,296
1,271
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!