Hello,

I had a very similar issue in Debian 9.

A Debian 9 system that indeed has interface configured with
allow-hotplug stanza in /etc/network/interfaces file, it fails to mount
nfs shares (over nfs4.0). From the journal it seems that dhclient
finishes **after** networking.service is activated. Networking.service
is the one that calls ifup -a. Hence other services including nfs mounts
are started early.

But if auto ensxx is added to interfaces then ordering is correct
(networking service is activated after ifup -a). I don't know if this is
documented somewhere. But it is important to note!

VG


Debian 9.13

ifupdown                                              0.8.19

systemd 232-25+deb9u13


/etc/fstab

10.2.0.10:/data/oc-data /data/oc-data nfs  timeo=20,_netdev  0 0


/etc/network/intefaces

# The primary network interface
allow-hotplug ens14
iface ens14 inet dhcp

Logs excerpt from "journalctl -b" after a failed auto mount reboot


allow-hotplug ens14
iface ens14 inet dhcp


Μάρ 02 15:37:08 host1 systemd[1]: Started Raise network interfaces.
Μάρ 02 15:37:10 host1 systemd[1]: Reached target Remote File Systems (Pre).
Μάρ 02 15:37:10 host1 systemd[1]: Reached target RPC Port Mapper.
Μάρ 02 15:37:10 host1 systemd[1]: Reached target Network is Online.
Μάρ 02 15:37:10 host1 dhclient[439]: Copyright 2004-2016 Internet
Systems Consortium
Μάρ 02 15:37:10 host1 systemd[1]: Mounting /data/oc-data...
Μάρ 02 15:37:11 host1 dhclient[439]: DHCPDISCOVER on ens14 to
255.255.255.255 port 67 interval 7
Μάρ 02 15:37:11 host1 dhclient[439]: DHCPREQUEST of 10.2.0.4 on ens14 to
255.255.255.255 port 67
Μάρ 02 15:37:11 host1 dhclient[439]: DHCPOFFER of 10.2.0.4 from 10.2.0.1
Μάρ 02 15:37:11 host1 dhclient[439]: DHCPACK of 10.2.0.4 from 10.2.0.1
Μάρ 02 15:37:11 host1 systemd[1]: data-oc\x2ddata.mount: Mount process
exited, code=exited status=32
Μάρ 02 15:37:11 host1 systemd[1]: Failed to mount /data/oc-data.



-------

#allow-hotplug ens14
auto ens14
iface ens14 inet dhcp


Μάρ 02 16:17:52 host1 systemd[1]: Starting Raise network interfaces..
Μάρ 02 16:17:56 host1 dhclient[455]: DHCPOFFER of 10.2.0.4 from 10.2.0.1
Μάρ 02 16:17:56 host1 ifup[420]: DHCPOFFER of 10.2.0.4 from 10.2.0.1
Μάρ 02 16:17:56 host1 dhclient[455]: DHCPACK of 10.2.0.4 from 10.2.0.1
Μάρ 02 16:17:56 host1 ifup[420]: DHCPACK of 10.2.0.4 from 10.2.0.1
Μάρ 02 16:17:57 host1 ifup[420]: bound to 10.2.0.4 -- renewal in 2959
seconds.
Μάρ 02 16:17:57 host1 systemd[1]: Started Raise network interfaces.
Μάρ 02 16:17:57 host1 systemd[1]: Reached target Network.
Μάρ 02 16:17:57 host1 systemd[1]: Reached target Network is Online.
Μάρ 02 16:17:57 host1 systemd[1]: Mounting /data/oc-data...
Μάρ 02 16:17:59 host1 systemd[1]: Mounted /data/oc-data.



----
allow-hotplug ens14
auto ens14
iface ens14 inet dhcp

Μάρ 02 16:28:23 host1 systemd[1]: Starting Raise network interfaces...
Μάρ 02 16:28:25 host1 sh[375]: DHCPOFFER of 10.2.0.33 from 10.2.0.1
Μάρ 02 16:28:25 host1 dhclient[422]: DHCPOFFER of 10.2.0.33 from 10.2.0.1
Μάρ 02 16:28:25 host1 dhclient[422]: DHCPACK of 10.2.0.33 from 10.2.0.1
Μάρ 02 16:28:25 host1 sh[375]: DHCPACK of 10.2.0.33 from 10.2.0.1
Μάρ 02 16:28:26 host1 dhclient[422]: bound to 10.2.0.33 -- renewal in
2976 seconds.
Μάρ 02 16:28:26 host1 systemd[1]: Started Raise network interfaces.
Μάρ 02 16:28:26 host1 systemd[1]: Reached target Network.
Μάρ 02 16:28:26 host1 systemd[1]: Reached target Network is Online.
Μάρ 02 16:28:26 host1 systemd[1]: Mounting /data/oc-data...

Reply via email to