Skip to content

Wait for network-online.target before mirror sync#3

Open
amikhailov7 wants to merge 1 commit into
mainfrom
network-online-target
Open

Wait for network-online.target before mirror sync#3
amikhailov7 wants to merge 1 commit into
mainfrom
network-online-target

Conversation

@amikhailov7
Copy link
Copy Markdown
Collaborator

systemd's network.target is passive — only signals that the network stack is loaded, not that the network is actually usable (interfaces configured, default route present, DNS responsive). Timers firing right after boot (especially with Persistent=true catching up missed runs) can race ahead of network readiness, causing rsync to exit 10 (socket I/O error) and the service to enter failed state until the next scheduled run.

Observed on a customer mirror host where post-reboot timer trigger hit a network race; a drop-in with the same fix resolved it.

systemd's network.target is passive — only signals that the network
stack is loaded, not that the network is actually usable (interfaces
configured, default route present, DNS responsive). Timers firing
right after boot (especially with Persistent=true catching up missed
runs) can race ahead of network readiness, causing rsync to exit 10
(socket I/O error) and the service to enter failed state until the
next scheduled run.

Replace After=network.target with After=network-online.target and add
Wants=network-online.target so the service waits until the network is
fully online before attempting to sync.

Affects all service templates across playbooks:
  - combined-mirror: cloudlinux-complete-mirror, cloudlinux-mirror, swng-mirror
  - complete-swng-rsync: swng-mirror
  - specific-version-rsync: swng-version-mirror
  - yum-reposync: swng-reposync

Observed on a customer mirror host where post-reboot timer trigger
hit a network race; a drop-in with the same fix resolved it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant