/etc/init.d/cpanel: No such file or directory. Restart cPanel CentOS 7
How to restart cPanel service on CentOS 7/RHEL 7 Server
-bash: /etc/init.d/cpanel: No such file or directory
Got the above error while trying to restart cPanel service via SSH on CentOS 7 server.
1. You must log into your CentOS 7 / Redhat server as ‘root’ user to restart cPanel service.
2. Use ‘systemctl’ command to restart cPanel service
Command to Restart cPanel on CentOS 7/RHEL 7 Server : systemctl restart cpanel.service
* cpanel.service - cPanel services
Loaded: loaded (/etc/systemd/system/cpanel.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2016-05-12 10:46:57 EDT; 11s ago
Process: 3268 ExecStart=/usr/local/cpanel/scripts/restartsrv_cpsrvd --no-verbose (code=exited, status=0/SUCCESS)
Main PID: 3277 (cpsrvd (SSL) - )
`-3277 cpsrvd (SSL) - waiting for connectionsMay 12 10:46:57 server systemd: Starting cPanel services...
May 12 10:46:57 server restartsrv_cpsrvd: ==> cpsrvd 22.214.171.124 started
May 12 10:46:57 server restartsrv_cpsrvd: ==> cpsrvd: loading security policy....Done
May 12 10:46:57 server restartsrv_cpsrvd: ==> cpsrvd: Setting up native SSL support ... Done
May 12 10:46:57 server restartsrv_cpsrvd: ==> cpsrvd: setting up serviceauth
May 12 10:46:57 server restartsrv_cpsrvd: ==> cpsrvd: bound to ports
May 12 10:46:57 server systemd: PID 3268 read from file /var/run/cpsrvd.pid does not exist or is a zombie.
After restarting cPanel service you can check the status of the service using the below command.
Command to check the status of cPanel Service on centOS 7 Server : systemctl status cpanel.service
root@server [~]# systemctl status cpanel.service
‘systemctl status cpanel.service’ command will show whether the service is running or not.
On CentOS 7 and RHEL 7 server, you can use the below commands to start, stop, restart cPanel service and also to check cPanel service status.
Command usage : systemctl [restart|start|stop|status] cpanel.service
To stop cPanel service: #systemctl stop cpanel.service
To start cPanel service: #systemctl start cpanel.service