There are occasions where you might come across some services being restarted/autostarted during cPanel's updates and when analyzing cPanel's error log you will see something similar to the following line that indicates that the service has been restated by the
==> /usr/local/cpanel/logs/error_log <==
[2020-11-24 03:48:18 +0200]: “/usr/local/cpanel/scripts/restartsrv_mysql ” called by (22796 - /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/scripts/find_outdated_services --auto)
/scripts/upcp runs many checks and tests during its execution in the form of scripts that are run at different stages of the update process to ensure that the system is optimal for the update. One such script is
/usr/local/cpanel/scripts/find_outdated_services which runs at the earlier stages of upcp's execution.
/scripts/upcp | grep -i find_outdated_services --line-buffered -C 2
[2020-11-24 09:21:17 -0600] Processing: Restarting any outdated services
[2020-11-24 09:21:17 -0600] 32% complete
[2020-11-24 09:21:17 -0600] - Processing command `/usr/local/cpanel/scripts/find_outdated_services --auto`
[2020-11-24 09:21:21 -0600] [/usr/local/cpanel/scripts/find_outdated_services] Looking for outdated services …
[2020-11-24 09:21:21 -0600] [/usr/local/cpanel/scripts/find_outdated_services] The system did not find any outdated services.
[2020-11-24 09:21:21 -0600] - Finished command `/usr/local/cpanel/scripts/find_outdated_services --auto` in 4.341 seconds
[2020-11-24 09:21:21 -0600] Processing: Running platform specific optimizations
[2020-11-24 09:21:21 -0600] 33% complete
This command examines your system and identifies any services that are “outdated”—i.e., that depend on libraries that are no longer present on the system. This can often happen when such libraries receive updates, e.g., from "yum".
The normal behavior of this script is to ask you whether you’d like to restart the outdated service(s); however, you can specify the "--always-restart" or "--never-restart" flags to bypass this prompt and either restart or not, respectively.
The "--auto" flag is specified when this script is run automatically from maintenance (AKA via upcp). By default, it acts as "--always-restart". So whenever this script runs if there are any outdated services they are restarted by default.
There are two ways that you can modify the default behavior of the
find_outdated_services script (--always-restart) so that the services are not autostarted.
Firstly, as mentioned before, the "--auto" flag is specified when this script is run automatically from maintenance. By default, it acts as "--always-restart"; however, if "
/var/cpanel/disabled/auto-restart-services" exists, it acts as "--never-restart" instead. So by creating the above file you can change the behavior of the find_outdated_services script.
Secondly, you can make this script ignore a given service by including the service name in
/etc/cpanel/local/ignore_outdated_services. This file is newline-delimited. Use a pound character ("#") at the start of a line to indicate a comment. For example, to exclude the services "cloud-init" and "cloud-final", your file might look this at the end:
# Prevent cPanel from checking about the cloud-init service