Child pages
  • The find_outdated_services Script

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel2
minLevel2
stylenone

Overview

After a system update, cPanel & WHM runs the /usr/local/cpanel/scripts/find_outdated_services script. This script checks all services to determine whether they require a restart. An outdated service is any service that depends on a library that is no longer present on the system.

Warning
titleImportant:

This script does not restart the following services:

  • NetworkManager
  • network

Run the script

To run this script on the command line, use the following format:

Code Block
languagebash
/usr/local/cpanel/scripts/find_outdated_services [options]

Options

Use the following options with this script:

OptionsDescription
--always-restartThe script locates and restarts any outdated services.
--never-restart

The script locates any outdated services but will not restart them.

--auto

By default, the script uses this option when it runs as part of the /usr/local/cpanel/scripts/maintenance script. It will locate and restart any outdated services. If the /var/cpanel/disabled/auto-restart-services touchfile exists, the system will not restart any outdated services.

The /etc/cpanel/local/ignore_outdated_services file

The /usr/local/cpanel/scripts/find_outdated_services script uses this file to exclude certain services from the script's check.

Warning
titleImportant:

The /usr/local/cpanel/scripts/find_outdated_services script does not apply this exclusion list to the chkservd or restartsrv services.

To exclude a service from this script, add it to the /etc/cpanel/local/ignore_outdated_services file. This file uses the following format:

  • Use the pound character (#) at the beginning of a line to mark it as a comment.

  • Enter only one service per line.

    Note
    titleNote:

    The service name must match its name as it appears in the process table. Use the  ps command with the necessary flags to list processes (for example, ps -aux).


  • Use Unix line endings to separate the entries.
  • The system skips blank lines.

For example, this file's contents would resemble the following:

Code Block
languagebash
linenumberstrue
# Prevent cPanel from checking about the cloud-init service
cloud-init
cloud-final

Example

We want to block the cloud-init and cloud-final services from restart checks. Create the /etc/cpanel/local directory:

Code Block
languagebash
mkdir -p /etc/cpanel/local

Create the /etc/cpanel/local/ignore_outdated_services file and add the cloud-init and cloud-final services with the following command:

Code Block
languagebash
echo -e "# Prevent cPanel from checking the cloud-init and cloud-final services\ncloud-init\ncloud-final" >> /etc/cpanel/local/ignore_outdated_services

Additional documentation

Localtab Group


Localtab
activetrue
titleSuggested documentation

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "services" and label = "whm" and space = currentSpace()


Localtab
titleFor cPanel users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "services" and label = "cpanel" and space in (currentSpace(),"DOC")


Localtab
titleFor WHM users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "services" and label = "whm" and space in (currentSpace(),"DOC")


Localtab
titleFor developers

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "services" and space = "DD"