# Written by the mesh (module dnsmasq, novox/hq issue 348). Replaced on every push. # # The resolver binds its addresses once, at start (bind-interfaces), so it starts only once this # machine's private address is there: a start that finds it missing fails after at most two seconds and # is tried again every ten seconds (Restart=on-failure, no start limit) until the tunnel has brought it. # It does not order itself After= or Wants= network-online.target, and its wait is short: the packaged # unit is Before= network-online.target and nss-lookup.target, and the tunnel is ordered after them, so # a long wait would hold the tunnel back and a drop-in ordering would be a cycle (issue 1126). [Unit] StartLimitIntervalSec=0 [Service] ExecStartPre=/usr/bin/sh -c 'for i in $(seq 1 2); do ip -4 -o addr show to ${machine:address} | grep -q . && exit 0; sleep 1; done; echo "${machine:address} is not on this machine" >&2; exit 1' Restart=on-failure RestartSec=10s