[CentOS-devel] NFSroot over wifi in CentOS 7 - graceful shutdown problem

Mon Jul 13 16:52:14 UTC 2020
R P Herrold <herrold at owlriver.com>

On Mon, 13 Jul 2020, Simon Matter via CentOS-devel wrote:

> > Guess what? Upon termination, wpa-supplicant brings the wireless
> > interface down and the system hangs being unable to unmount now-defunct
> > NFSroot.

This sounds like a use case for a 'unit' file.  See 
	man 5 systemd.unit

wpa-supplicant is providing 'network' and being shut down 'too 
early

I use the following unit file, to mount a NFS point after the 
network is up (wotjh tje 'After'), and systemd will retain the 
network in an up state so loong as the mount point it up (with 
the 'Wants')

# less /etc/systemd/system/var-ftp-pub-nfs-mirror.mount

[Unit]
Description=var-ftp-pub-nfs-mirror devices  
Wants=network-online.target
After=network-online.target
Conflicts=umount.target
[Mount]
What=nas1.first.owlriver.net:/Mirror
Where=/var/ftp/pub/nfs/mirror
Type=nfs

[Install]
WantedBy=machines.target  

#######################

Rename the unit file with the mount point name, and drop it in 
the indicated directory path [it is unclear to me if this 
needs to be in the datastick you are initially booting from, 
or in the filesystem once active .. some experimentation 
needed here.  It may well be both ;)  You may find more 
guidance in a writeup on a wired PXE / TFTP boot ]
	(see: man 5 systemd.unit )

and one assumes wpa-supplicant is already designated as part 
of the 'network' service, and so will be retrained in an 
active state unti the umount of listed NFS mounts are 
completed

-- Russ herrold