How to Restart Services

How to Restart Services

Failure to restart

If this interface fails to restart a service, the service may have additional problems. For additional (command line) methods to restart services and troubleshoot service issues,Read the below documentation

This document describes several methods to restart the services (often daemons) on your server. Daemons are small processes that run in the background of your server.

You may wish to restart a service if, for example, you changed a service’s configuration, or if the service experiences problems.

 

Note:

Whenever you change the server's hostname, you must use one of the following methods: 

These methods ensure that all of the necessary system and service changes occur.

Important:

If you update your hostname, the system blocks user access to the following interfaces and services:

  • Horde Webmail
  • Calendars and Contacts (CalDAV/CardDAV)

The system restores access to these interfaces and services after the hostname update completes. For more information, read our Interface Lock Scripts documentation.

 

Restart services in the WHM interface

Unless problems prevent this, you can restart most services in WHM's Restart Services interface (Home >> Restart Services).

Restart services from the command line

Important:

If you use IPv6, the service network restart command will remove the IPv6 addresses from the network device. To restart your IPv6 configuration after you run the service network restart command, you must run the appropriate command for your version of cPanel & WHM:

  • For cPanel & WHM version 11.52 and earlier, run the /etc/init.d/cpipv6 restart command after you restart the network service. 
  • For cPanel & WHM version 54 and later, run the /scripts/restartsrv_cpipv6 command after you restart the network service.

Use the restartsrv script

If a service will not restart from WHM, use the /usr/local/cpanel/scripts/restartsrv service command to attempt to restart the service from the command line. When you run this command, replace service with the correct value for that service. For more information, read our WHM Scriptsdocumentation.

Direct service restart

If the /usr/local/cpanel/scripts/restartsrv script does not restart the service, you can attempt to restart the service directly.

For servers that run CentOS, CloudLinux™, or Red Hat® Enterprise Linux (RHEL) 5 or 6, run the following command, where /etc/rc.d/init.d/serviceis the path to the service:

/etc/rc.d/init.d/service restart

For servers that run CentOS 7, CloudLinux 7, or RHEL 7, run the following command, where service-name is the service that you wish to restart:

systemctl restart service-name.service

Service error logs

If the restart fails, check the service’s error log for help to diagnose the issue. Because each service logs its errors differently, check the service’s documentation to find the error log’s location.

The following table lists common locations for some service's error logs:

ServicesLog locationNotes

Apache web server

/usr/local/apache/logs/error_log

Details errors encountered during Apache requests.

  • BIND nameserver
  • ProFTP FTP server
  • Pure-FTP FTP server

/var/log/messages

 

Exim mail transfer agent (MTA)

 

 

/var/log/exim_mainlog

Details all Exim transactions.

/var/log/exim_rejectlog

Details rejected messages and reasons.

/var/log/exim_paniclog

Details configuration and similar errors.

Important:

If this log is not empty, Exim has serious problems and will not run on some distributions.

  • Courier mail server
  • Dovecot mail server

/var/log/maillog

Warning:

We removed the Courier mail server in cPanel & WHM version 54. The Courier mail server only exists for cPanel & WHM version 11.52 and earlier.

MySQL database server

/var/lib/mysql/hostname.err

Substitute hostname with your server's hostname.

OpenSSH secure shell service

/var/log/messages

The log file's location depends on the configuration of the syslog service.

/var/log/secure
/var/log/auth
 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Restart Services

Restart Services This interface allows you to restart a service (usually a daemon) on your web...