Fix long delays when booting without a public IP
When booting an Instance lacking a public IP address and connected to a Private Network, users may encounter significant delays during the boot process. This delay is particularly noticeable in Ubuntu Jammy, where it can extend up to 5 minutes. Other distributions may experience delays of approximately 2 minutes during boot. The cause of this delay stems from systemd’s failure to configure the public network interface, waiting for a timeout before further boot operations proceed.
To minimize boot delays, you can manually implement a bypass in the systemd-networkd-wait-online.service
:
-
Create a directory for additional systemd service configurations:
mkdir /etc/systemd/system/systemd-networkd-wait-online.service.d -
Create a configuration file within the directory to adjust the timeout:
cat >/etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-5-seconds.conf<<EOF[Service]ExecStart=ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --timeout=5 --anyEOF
This adjustment will take effect upon the next system reboot, reducing the timeout to 5 seconds to avoid boot delays caused by network configuration.