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

Bug#860264: Acknowledgement (nfs-kernel-server: NFS starts before DNS works, "exportfs: Failed to resolve ...")



I believe I was able to get this working by making a change to the
/etc/network/interfaces file:

# allow-hotplug eth0
auto eth0
iface eth0 inet dhcp

I replaced the allow-hotplug with auto.  Now, after booting, it appears
to be working:

wooledg:~$ sudo systemctl status nfs-server
* nfs-server.service - NFS server and services
   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor prese
  Drop-In: /etc/systemd/system/nfs-server.service.d
           `-waitlonger.conf
   Active: active (exited) since Mon 2017-04-17 08:57:17 EDT; 2min 17s ago
  Process: 555 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/
  Process: 552 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS
 Main PID: 555 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/nfs-server.service

Apr 17 08:57:17 wooledg systemd[1]: Starting NFS server and services...
Apr 17 08:57:17 wooledg systemd[1]: Started NFS server and services.

wooledg:~$ /sbin/showmount -e
Export list for wooledg:
/home ebase-fla.eeg.ccf.org,ebase.eeg.ccf.org

I only tested one time, though.  There might still be a race condition.

Inspiration for this came from
https://unix.stackexchange.com/questions/209832/debian-systemd-network-online-target-not-working
which shows an Ubuntu unit file (not present on my stretch installation).
This unit uses the "ifquery --list --exclude lo --allow auto" command to
try to determine which interfaces it should wait for.  This command did
not work for me, since my interface had been created by the installer with
"allow-hotplug" instead of "auto".

So, on the theory that maybe systemd's "network-online.target" is doing
something similar to this, I tried the change.  It seemed to work.

Systemd brags about how great its documentation is, but it doesn't bother
explaining what network-online.target actually does, or how to make it
work.

Digging around some more (for the benefit of anyone who may be reading
this bug report and trying to learn, as I am):

wooledg:~$ systemctl list-dependencies network-online.target
network-online.target
* `-networking.service

wooledg:~$ cat /lib/systemd/system/networking.service
[...]
[Service]
Type=oneshot
EnvironmentFile=-/etc/default/networking
ExecStartPre=-/bin/sh -c '[ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle'
ExecStart=/sbin/ifup -a --read-environment
ExecStop=/sbin/ifdown -a --read-environment --exclude=lo
RemainAfterExit=true
TimeoutStartSec=5min

wooledg:~$ man ifquery
[...]
       -l, --list
              For  ifquery,  list all the interfaces which match the specified
              class.  If no class specified, prints all the interfaces  listed
              as auto.
[...]

Again, the reference to "auto".  Apparently "allow-hotplug" breaks all
kinds of things.


Reply to: