systemd-networkd-wait-online doesn't wait for DNS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Is there a way to tell the systemd-networkd-wait-online service to wait
until DNS is working before continuing?

I have an issue where I need an NFS share mounted during boot, but the
automount process is failing because the "mount" command can't resolve
the hostname of the server during boot.  (However it works fine after
the boot process has finished.)

I tried enabling systemd-networkd-wait-online@eth0.service and while
the logs show this delaying the automount by three seconds, it still
fails with the DNS error.

I'm using systemd-resolved for DNS, however the logs show it starting
well before systemd-networkd-wait-online completes, so I'm not really
sure what could be going on?

Here are the relevant logs:

21:16:40 systemd[1]: systemd-resolved.service: Job 268 systemd-resolved.service/start finished, result=done
21:16:40 systemd[1]: Started Network Name Resolution.
21:16:41 systemd[1]: mnt-example.mount: starting held back, waiting for: network-online.target
21:16:41 systemd[1]: Starting Wait for Network Interface eth0 to be Configured...
21:16:41 (t-online)[500]: systemd-networkd-wait-online@eth0.service: Executing: /usr/lib/systemd/systemd-networkd-wait-online -i eth0
21:16:41 systemd-networkd[488]: eth0: Link UP
21:16:43 systemd-networkd[488]: eth0: Gained carrier
21:16:44 systemd[1]: Finished Wait for Network Interface eth0 to be Configured.
21:16:44 systemd[1]: mnt-example.mount: About to execute: /usr/bin/mount myserver:/path /mnt/example[...]
21:16:44 systemd[1]: Mounting /mnt/example...
21:16:44 (mount)[533]: mnt-example.mount: Executing: /usr/bin/mount myserver:/path /mnt/example[...]
21:16:49 mount[535]: mount.nfs4: Failed to resolve server myserver: Name or service not known
21:16:49 systemd[1]: Failed to mount /mnt/example.
21:16:49 systemd[1]: mnt-example.mount: Unit entered failed state.

The automount works perfectly after the system has finished booting,
it's only during the boot process itself that mounting fails.  All I
have to do is "ls" into the directory and it gets mounted, with the
logs looking as they should - no errors or warnings, it just says it
completed successfully, which it did.

What am I doing wrong?  Is there a specific unit I have to enable to
wait until DNS is configured before attempting mounts of network
filesystems?

Many thanks,
Adam.



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux