The restartsrv Script

Valid for versions 100 through the latest version


Last modified: July 28, 2022

Overview

The /usr/local/cpanel/scripts/restartsrv script restarts a service. If a service wont restart from WHM, use this script to restart a service from the command line.

Run the script

To run this script on the command line, use the following format, where service is the services name:

/usr/local/cpanel/scripts/restartsrv_service

Options

Important:

Some options my be unavailable for certain services.

Use the following options with this script:

Options Description Example
check Checks whether the service is running. --check
graceful Gracefully restart the service. --graceful
hard Perform a hard stop and restart for the service. --hard
notconfigured-ok The unconfigured service will exit with a non-fatal error. --notconfigured-ok
reload Reload the service. --reload
restart Perform a soft restart for the service. --restart
start Start the service. --start
stop Stop the service. --stop
help Display the scripts help documentation. --help

Services

This script restarts the following services:

  • apache or httpd  The Apache® web server daemon.
  • apache_php_fpm  The Apache PHP-FPM service.
  • bind  The Berkeley Internet Name Domain (BIND) nameserver daemon.
  • chkservd or tailwatch  cPanel & WHMs TailWatch log processing service.
  • clamd  The ClamAV® antivirus daemon.
  • cpanalysticsd  The cPanel Analytics daemon.
  • cpanellogd  The cPanel log and bandwidth processor daemon.
  • cpanel_ccs  The cPanel Calendar and Contacts server service.
  • cpanel_dovecot_solr  The Apache Solr service.
  • cpanel_php_fpm  The cPanel PHP-FPM service.
  • cpdavd  cPanel & WHMs WebDAV daemon.
  • cpgreylistd  cPanels Greylisting.
  • cphulkd  The cPHulk service.
  • cpipv6  Binds or rebinds the servers IPv6 addresses.
  • cpsrvd or cpanel  The cPanel server daemon.
  • crond  The Cron daemon.
    Note:

    While Debian® systems (Ubuntu®) use the cron daemon, you can use crond as the service name when running the script.

  • dnsadmin  The cPanel Domain Name System (DNS) admin cache service.
  • dovecot  The Dovecot mail server.
  • exim  The Exim mail exchanger.
  • ftpdftpdftpmagic, or ftpserver  The configured FTP service (ProFTPD or Pure-FTPd).
  • imappop, or pop3  The Dovecot Internet Mail Access Protocol (IMAP) daemon.
  • ipaliases  The IP address aliasing software.
  • lmtp  The Local Mail Transport Protocol (LMTP) service.
  • mailman  The Mailman service.
  • mydns  The MyDNS server.
    Important:

    We deprecated MyDNS in cPanel & WHM version 78. We strongly recommend that you use PowerDNS instead.

  • mysql or mysqld  The MySQL® service.
  • named  The BIND nameserver daemon.
  • nscd  The Name Service Cache service.
  • p0f  The passive OS fingerprinting service.
  • pdns or powerdns  The PowerDNS service.
  • postgres or postgresql  The PostgreSQL® database service.
  • proftpd  The ProFTP server daemon.
  • pureftpd  The Pure-FTPd server daemon.
  • queueprocd  The TaskQueue Processor daemon.
  • rsyslog or rsyslogd  The system log service that monitors the web server and system activity.
  • spamd  The Apache SpamAssassin daemon.
  • sshd or openssh  The Secure Shell (SSH) daemon.
  • tailwatchd or chkservd  cPanels TailWatch log processing daemon.
  • tomcat  The Apache Tomcat® service.

For more information about these services, read our cPanel & WHM Service Daemons documentation.

Example

To perform a hard restart for a service, use the restart and hard options. For example, to perform a hard restart for the named service:

/usr/local/cpanel/scripts/restartsrv_named --restart --hard
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The servers_queue Script

Valid for versions 82 through the latest version Last modified: June 21, 2021...

The auto-adjust-mysql-limits Script

Valid for versions 82 through the latest version Last modified: June 21, 2021...

The autossl_check Script

Valid for versions 82 through the latest version Last modified: May 13, 2020 Overview...

The backup Script

Valid for versions 82 through the latest version Last modified: May 13, 2020 Overview...

The backup_restore_manager Script

Valid for versions 82 through the latest version Last modified: July 28, 2022...