# /etc/systemd/system/wg-quick@wg0.service.d/10-boot-resilience.conf # The stock unit already has After=/Wants=network-online.target nss-lookup.target. # This makes a boot-time failure (DHCP/DNS not ready yet, endpoint host offline) # retry forever instead of leaving the tunnel down until someone logs in. [Unit] # Unlimited retries: do not let the start rate limiter give up on us. StartLimitIntervalSec=0 [Service] # Fail fast instead of hanging forever on endpoint resolution (stock value is # infinity), then let Restart= try again. Same variable as the stock unit, # later assignment wins. Environment=WG_ENDPOINT_RESOLUTION_RETRIES=60 TimeoutStartSec=120 TimeoutStopSec=30 Restart=on-failure RestartSec=15