Help automount at boot NFS share external HDD

With the introduction of Debian stretch, nfs-kernel-server has been properly brought under systemd. (So you can say goodbye to service blah-blah start from now on.)

Probably, the best thing at this stage is for you to describe your hardware set-up in a bit more detail and provide logs by running grab-logs -A (and post the URL it returns).

I, too, now encountered this problem: nfs server fails to start on boot. This was well known to me for my previous rasbian setup. I had to use raspi-config and enabled its wait for network option.

raspi-config now isn’t available within OSMC. I have tried to use the similar option from within My OSMC - without success.

I tried systemctl enable connman-wait-for-network - again no success.

Thus my question is: Howto enforce waiting for network from within OSMC?

Or is there a completely differrent approach? My goal is to start the NFS server and autofs.

I’m running OSMC November 2021 release on a rasp pi 3 with an SSD connected.

Additional information: I do need NFS because I mount my main drive using autofs. If NFS fails, autofs doesn’t mount my local drive. As a consequence some osmc configuration files are not available which will disturb kodi of course.

Regards, Michael

Maybe I’ve discovered a solution myself:

I use autofs to maintain the folder /shared. It contains a subfolder named imurr9 resembling my local SSD, but mounted by autofs. Exactly /shared/imurr9 is within /etc/exports to be exported via NFS. Probabely NFS and autofs wait for each other. Thus my idea was to provide an empty directory as a placeholder during boot to help NFS starting

sudo bash
systemctl stop autofs
cd /shared
mkdir imurr9
systemctl start autofs

The consequence is that the folder /shared/imurr9 exist during NFS startup while autofs is not running and did still not mount the SSD. Then finally the SSD will be mounted and exported.

I tried one reboot, and NFS is running automatically.

Regards, Michael