HoganHost blog

[email protected]

What Scripts Are Executed When /scripts/upcp Runs

 

 

 

 

 

 

 

 

 

 

Understanding the Scripts Executed During /scripts/upcp in cPanel Servers

In the realm of web hosting management, cPanel stands out as one of the most popular control panel solutions, offering a suite of tools that streamline server administration tasks. Among its many features, cPanel includes an essential utility known as /scripts/upcp. This script, which stands for “update control panel,” plays a critical role in keeping cPanel servers up-to-date and secure. However, what exactly happens under the hood when /scripts/upcp runs?

The Purpose of /scripts/upcp

Before delving into the specifics of the scripts executed during /scripts/upcp, it’s essential to understand its primary purpose. When invoked, /scripts/upcp initiates the update process for the cPanel & WHM software, ensuring that the server’s control panel and associated components are running the latest stable versions. This helps enhance security, stability, and performance while also introducing new features and bug fixes.

The Sequence of Execution

When you execute /scripts/upcp, it triggers a series of scripts and processes designed to update various components of the cPanel & WHM environment. While the exact sequence and specific scripts may vary based on the server’s configuration and installed software versions, a typical update process involves the following key steps:

  1. Pre-Update Tasks: Before initiating the update process, /scripts/upcp performs several pre-update tasks to ensure a smooth transition. This may include checking for prerequisites, verifying system requirements, and backing up critical configuration files to prevent data loss or service disruptions during the update.
  2. Package Updates: The update process begins with the retrieval and installation of updated cPanel & WHM packages from the official cPanel repositories. This includes updates to the control panel software, addons, plugins, and other related components essential for server management.
  3. Service Restarts: After installing the updated packages, /scripts/upcp restarts essential services and daemons to apply the changes effectively. This step ensures that the updated software components are loaded into memory and that any configuration changes take effect immediately.
  4. Post-Update Tasks: Once the update process is complete, /scripts/upcp performs various post-update tasks to finalize the installation and configuration changes. This may involve rebuilding system configurations, updating database schemas, and performing additional checks to ensure the integrity of the updated environment.

Scripts Involved in /scripts/upcp

While /scripts/upcp serves as the primary entry point for initiating updates, it calls several underlying scripts and utilities to perform specific tasks during the update process. Some of the key scripts and utilities commonly invoked during /scripts/upcp include:

  • updatenow: This script downloads the latest cPanel & WHM updates from the official cPanel repositories and prepares them for installation.
  • upcp: The main update script, responsible for coordinating the update process, executing pre-update and post-update tasks, and managing the overall update workflow.
  • pkgacct: This utility is used to package and backup cPanel accounts before performing system updates or migrations. It ensures that user data remains intact and can be restored in case of any unforeseen issues during the update process.
  • sysup: This script checks for system updates and patches to address security vulnerabilities and software bugs outside the scope of cPanel & WHM updates. It helps maintain the overall security and stability of the server’s underlying operating system.
  • /scripts/restartsrv_: These scripts are responsible for restarting specific services and daemons after the update process to apply configuration changes and ensure proper functioning of the updated software components. The asterisk () represents the name of the service or daemon being restarted, such as Apache, MySQL, or DNS.

IN Addition

Here I will try to include the arguments passed to each script for comprehensiveness purposes. Also when a script is highlighted it means that all the scripts under that highlighted script are executed within the highlighted script.

Additionally, not all of these scripts are going to be run each time /scripts/upcp is executed. Whether each one is executed or not depends on many different factors which we will not be discussing here. The purpose of this guide is only to show you what scripts are expected to be executed when /scripts/upcp is running.

/scripts/upcp

'/usr/local/cpanel/scripts/upcp'
'/usr/local/cpanel/scripts/gather-update-logs'
'/usr/local/cpanel/scripts/hook'
'/usr/local/cpanel/scripts/hook', '--category=System', '--event=upcp', '--stage=post'
'/usr/local/cpanel/scripts/hook', '--category=System', '--event=upcp', '--stage=pre'
'/usr/local/cpanel/scripts/maintenance', '--log=' . $logfile_path, '--pbar-start=20', '--pbar-stop=95'
'/usr/local/cpanel/scripts/maintenance', '--post', '--log=' . $logfile_path, '--pbar-start=55', '--pbar-stop=95'
'/usr/local/cpanel/scripts/maintenance', '--pre', '--log=' . $logfile_path, '--pbar-start=20', '--pbar-stop=30'
'/usr/local/cpanel/scripts/post_sync_cleanup', '--log=' . $logfile_path, '--pbar-start=30', '--pbar-stop=55'
'/usr/local/cpanel/scripts/postupcp'
'/usr/local/cpanel/scripts/preupcp'
'/usr/local/cpanel/scripts/try-later'
'/usr/local/cpanel/scripts/upcp'
'/usr/local/cpanel/scripts/upcp', @retain_argv, '--fromself'
'/usr/local/cpanel/scripts/upcp-running'
'/usr/local/cpanel/scripts/updatenow', "--log=$logfile_path", '--checkremoteversion'
'/usr/local/cpanel/scripts/updatenow', '--upcp'

/usr/local/cpanel/scripts/maintenance

'/usr/local/cpanel/scripts/link_3rdparty_binaries'
'/usr/local/cpanel/scripts/rdate'
'/usr/local/cpanel/scripts/find_outdated_services --auto'
'/usr/local/cpanel/scripts/checkccompiler'
'/usr/local/cpanel/bin/migrate_all_feature_lists_to_current'
'/usr/local/cpanel/scripts/mainipcheck'
'/usr/local/cpanel/scripts/update_neighbor_netblocks'
'/usr/local/cpanel/scripts/update_known_proxy_ips'
'/usr/local/cpanel/scripts/check_valid_server_hostname --notify'
'/usr/local/cpanel/scripts/checkusers'
'/usr/local/cpanel/scripts/vzzo-fixer'
'/usr/local/cpanel/scripts/quota_auto_fix'
'/usr/local/cpanel/scripts/clear_orphaned_virtfs_mounts --inactiveonly'
'/usr/local/cpanel/scripts/disable_prelink'
'/usr/local/cpanel/scripts/cleanquotas'
'/usr/local/cpanel/scripts/autorepair autorepair'
'/usr/local/cpanel/scripts/purge_old_config_caches'
'/usr/local/cpanel/scripts/cleansessions'
'/usr/local/cpanel/scripts/checkbashshell'
'/usr/local/cpanel/scripts/dnsqueuecron'
'/usr/local/cpanel/scripts/rebuild_whm_chrome'
'/usr/local/cpanel/bin/checkallsslcerts --allow-retry --verbose'
'/usr/local/cpanel/scripts/check_domain_tls_service_domains.pl --prune'
'/usr/local/cpanel/scripts/clean_up_temp_wheel_users'
'/usr/local/cpanel/scripts/findphpversion'
'/usr/local/cpanel/scripts/listcheck'
'/usr/local/cpanel/scripts/updateuserdomains'
'/usr/local/cpanel/bin/empty_user_trash --quiet --all'
'/usr/local/cpanel/bin/empty_user_horde_temp_files --quiet --all'
'/usr/local/cpanel/scripts/build_maxemails_config'
'/usr/local/cpanel/scripts/updateuserdatacache --force'
'/usr/local/cpanel/scripts/check_maxmem_against_domains_count --always-fix'
'/usr/local/cpanel/scripts/resetmailmanurls'
'/usr/local/cpanel/scripts/mysqlconnectioncheck'
'/usr/local/cpanel/bin/postgrescheck --check-auth --reset-pass-on-fail'
'/usr/local/cpanel/scripts/chkpaths'
'/usr/local/cpanel/scripts/hackcheck'
'/usr/local/cpanel/scripts/oopscheck'
'/usr/local/cpanel/scripts/fixetchosts'
'/usr/local/cpanel/scripts/check_unreliable_resolvers --notify'
'/usr/local/cpanel/bin/is_script_stuck --script=autossl_check --time=22h --kill --notify=root'
'/usr/local/cpanel/scripts/quotacheck'
'/usr/local/cpanel/scripts/email_archive_maintenance'
'/usr/local/cpanel/scripts/email_hold_maintenance'
'/usr/local/cpanel/scripts/expunge_expired_certificates_from_sslstorage'
'/usr/local/cpanel/scripts/notify_expiring_certificates'
'/usr/local/cpanel/scripts/notify_expiring_certificates_on_linked_nodes'
'/usr/local/cpanel/scripts/expunge_expired_transfer_sessions'
'/usr/local/cpanel/scripts/expunge_expired_pkgacct_sessions'
'/usr/local/cpanel/scripts/smartcheck'
'/usr/local/cpanel/scripts/compilerscheck'
'/usr/local/cpanel/scripts/check_mount_procfs'
'/usr/local/cpanel/scripts/setup_modsec_db'
'/usr/local/cpanel/scripts/modsec_vendor update --auto'
'/usr/local/cpanel/bin/check_cpstore_in_sync_with_local_storage'
'/usr/local/cpanel/scripts/compilers restore'
'/usr/local/cpanel/scripts/dovecot_maintenance --background'
'/usr/local/cpanel/bin/clean-datastores --background root'
'/usr/local/cpanel/scripts/spamassassin_dbm_cleaner'
'/usr/local/cpanel/scripts/check_security_advice_changes --notify --background'
'/usr/local/cpanel/bin/dcpumon --killproc'
'/usr/local/cpanel/bin/setupdbmap'
'/usr/local/cpanel/bin/fix_userdata_perms'
'/usr/local/cpanel/scripts/detect_env_capabilities'
'/usr/local/cpanel/scripts/manage_greylisting --init --update_common_mail_providers'
'/usr/local/cpanel/scripts/migrate_local_ini_to_php_ini --run --verbose'
'/usr/local/cpanel/scripts/check_mysql', 
'/usr/local/cpanel/bin/refresh_plugin_cache'
'/usr/local/cpanel/scripts/ccs-check --run --ssl'
'/usr/local/cpanel/scripts/perform_sqlite_auto_rebuild_db_maintenance'
'/usr/local/cpanel/scripts/vps_optimizer'
'/usr/local/cpanel/bin/purge_dead_comet_files --quiet'
'/usr/local/cpanel/scripts/update-packages'
'/usr/local/cpanel/scripts/process_pending_cpanel_php_pear_registration'
'/usr/local/cpanel/scripts/sysup'
'/usr/local/cpanel/scripts/find_and_fix_rpm_issues'
'/usr/local/cpanel/scripts/updatesigningkey'
'/usr/local/cpanel/bin/cloudlinux_update'
'/usr/local/cpanel/scripts/mkwwwacctconf'
'/usr/local/cpanel/scripts/fixrndc -f'
'/usr/local/cpanel/scripts/fixrndc'
'/usr/local/cpanel/scripts/check_cpanel_pkgs'
'/usr/local/cpanel/scripts/ftpquotacheck'
'/usr/local/cpanel/scripts/restartsrv mysql'
'/usr/local/cpanel/scripts/purge_modsec_log'
'/usr/local/cpanel/scripts/buildeximconf --no_chown_spool'
'/usr/local/cpanel/scripts/restartsrv_eximstats'
'/usr/local/cpanel/scripts/litespeed-check --run'
'/usr/local/cpanel/scripts/jetbackup-check --run'
'/usr/local/cpanel/bin/wpt_license --download'

/usr/local/cpanel/scripts/try-later

'/usr/local/cpanel/scripts/cpservice'

Note: The following scripts are usually part of the cPanel hook system so as a result they are executed only when there are already custom scripts configured to be run during the upcp through the hook system:

'/usr/local/cpanel/scripts/hook'
'/usr/local/cpanel/scripts/postupcp'
'/usr/local/cpanel/scripts/preupcp'

So these three could also execute other extra scripts, depending on what has been hooked to them.

Conclusion

In conclusion, /scripts/upcp is a critical component of cPanel server management, facilitating the seamless update and maintenance of the cPanel & WHM software stack. By understanding the scripts and processes executed during /scripts/upcp, server administrators can effectively manage and optimize their cPanel environments, ensuring the highest levels of security, stability, and performance for their web hosting infrastructure. As with any system update process, it’s essential to perform regular backups and testing to mitigate risks and minimize disruptions to production environments.

Check out our cheap and reliable web hosting

Leave a Comment

Your email address will not be published. Required fields are marked *