All Products
Search
Document Center

:Methods to handle and prevent network exceptions caused by the automatic operating system update of RDS Custom instances

Last Updated:Dec 04, 2025

When RDS Custom instances are configured with dual network interface cards (eth0 and eth1), automatic operating system updates might cause network exceptions. This topic describes methods to handle and prevent such issues.

Handling method

If you have encountered this issue, you can execute the /etc/rds_custom_init.sh script to initialize the network. This initialization process will not restart the instance.

  1. Connect to the RDS Custom instance.

    1. Log on to the RDS Management Console, click RDS Custom > Instances in the navigation pane on the left, and then select a region at the top.

    2. Click the instance ID to go to the instance details page.

    3. Click Remote Connection in the upper-right corner, and then click Log On on the page that appears.

      image

    4. On the VNC page, log on to the RDS Custom instance as the root user with the password.

  2. Execute the sudo /etc/rds_custom_init.sh script to initialize the network.

Prevention methods

Ubuntu operating system

In RDS Custom instances with Ubuntu operating system, when the instance is configured with dual network interface cards (eth0 and eth1), the Advanced Package Tool (APT) will trigger an automatic system restart when systemd is automatically upgraded. This restart might cause the network service to restart, resulting in route loss and network exceptions.

You can effectively prevent system restarts caused by automatic updates and avoid network exceptions by disabling automatic system updates. Take Ubuntu 24.04 64-bit operating system as an example:

  1. Connect to the RDS Custom instance.

    1. Log on to the RDS Management Console, click RDS Custom > Instances in the navigation pane on the left, and then select a region at the top.

    2. Click the instance ID to go to the instance details page.

    3. Click Remote Connection in the upper-right corner, and then click Log On on the page that appears.

      image

    4. On the VNC page, log on to the RDS Custom instance as the root user with the password.

  2. Disable the unattended-upgrades service.

    #Stop the currently running unattended-upgrades service
    sudo systemctl stop unattended-upgrades
    #Disable automatic startup
    sudo systemctl disable unattended-upgrades
  3. Modify the automatic update configuration file.

    1. Edit the automatic update configuration file /etc/apt/apt.conf.d/20auto-upgrades.

      vi  /etc/apt/apt.conf.d/20auto-upgrades
    2. Modify the configuration file to the following content to disable all automatic update functions.

      APT::Periodic::Update-Package-Lists "0";
      APT::Periodic::Unattended-Upgrade "0";
  4. Disable systemd scheduled tasks.

    1. List all APT-related systemd timers.

      systemctl list-timers | grep apt
      # or
      systemctl list-unit-files | grep apt

      Return result:

      apt-daily-upgrade.service                  static          -
      apt-daily.service                          static          -
      apt-news.service                           static          -
      apt-daily-upgrade.timer                    enabled         enabled
      apt-daily.timer                            enabled         enabled
    2. Disable and stop the related timers. For example:

      sudo systemctl stop apt-daily.timer
      sudo systemctl disable apt-daily.timer
      sudo systemctl stop apt-daily-upgrade.timer
      sudo systemctl disable apt-daily-upgrade.timer
    3. Execute the following commands to confirm that the related timers have been stopped and disabled.

      systemctl status apt-daily.timer
      systemctl status apt-daily-upgrade.timer
  5. Disable cron scheduled tasks.

    1. Execute the following commands to check cron scheduled tasks.

      sudo cat /etc/cron.daily/apt
      sudo cat /etc/cron.weekly/apt.update
    2. If cron scheduled tasks exist, comment out the relevant entries to disable the task. For example:

      # #!/bin/sh
      # apt-get -y update
      # apt-get -y upgrade

Other operating systems

Take CentOS 7.8 as an example. For other operating systems, make corresponding adjustments according to their versions.

  1. Connect to the RDS Custom instance.

    1. Log on to the RDS Management Console, click RDS Custom > Instances in the navigation pane on the left, and then select a region at the top.

    2. Click the instance ID to go to the instance details page.

    3. Click Remote Connection in the upper-right corner, and then click Log On on the page that appears.

      image

    4. On the VNC page, log on to the RDS Custom instance as the root user with the password.

  2. Execute the following command to check whether the yum-cron service is enabled.

    sudo systemctl status yum-cron

    If it is enabled, execute the following commands to stop the currently running yum-cron service.

    # Stop the currently running yum-cron service
    sudo systemctl stop yum-cron
    # Disable automatic startup
    sudo systemctl disable yum-cron
  3. Check and close the cron service.

    grep yum /etc/crontab /etc/cron.d/*

    If cron tasks exist, comment out the relevant entries to disable the task. For example:

    # 0 */4 * * * root /usr/sbin/yum-cron

References

For more information, see Introduction to RDS Custom