If my NFS mounts fails KODI does not load

When NFS mounts fail causing Kodi to not load…

I map , for example; /home/osmc/Videos to an NFS share

I have tried many options in /etc/fstab however when boot fails Kodi does not load.

I want the NFS mounts to be optional. For instance If I connect a Pi where the NFS shares are available, I want it to mount them at boot. However when They are not available, I am happy seeing the local directory. I guess what I need are the right options that allow the mouunt to fail gracefully and continue booting.

I have tried among others                      /home/osmc/Videos                     nfs     defaults,nolock,x-systemd.automount,noatime   0 0                      /home/osmc/Videos                     nfs     noauto,nolock,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime   0 0

Anyone have WORKING exampless or know the secret handshake?

are you using mysql as well? My kodi fails to load anything if the db is not available, yet if you unplug the Ethernet cable and then start it work without issue.

No, this is a pure NFS issue. Not using shared database.

Try changing hard to soft on the second example - you should never use a hard mount for an NFS server that may be unavailable because hard means keep waiting forever for the server to appear.

Tried that already among many other combinations.

I see this as a BUG , in fact a big ole HAIRY BUG

Before you got making bold pronouncements that there is a BIG HAIRY BUG you need to first provide some proper debugging information other than just “Kodi doesn’t load” (which doesn’t really help at all) and make an effort to understand how systemd handles NFS mounts and service startup - which is very different to nearly every other init system, meaning that a lot of advice on the internet on how to configure nfs mounts is FLAT WRONG for systemd.

As far as I can see there is no bug, simply that the default behaviour is not what you expect/want it to be, and that you haven’t found the correct mount options to do what you want.

If you look at the service unit that starts Kodi you will see that it is configured to wait on remote-fs.target:

This means that systemd will not start Kodi until it is satisfied that remote file systems have been mounted. In your case it is probably (based on the very slim amount of information you have provided) waiting for your NFS mount that never mounts.

Kodi waiting for remote file systems might be a BUG for you but a feature for someone else. If we do not wait for manually specified (fstab) remote file systems to mount before loading Kodi and that file system for example held the entire /home/osmc directory, or /home/osmc/.kodi/ Kodi would not load properly at all. So this dependency is necessary to handle situations where the NFS connection is available but might not connect quickly enough before Kodi would load. (Otherwise you have a race condition)

Because your NFS server is not always available and it is not mission critical if it does not mount, you need to find the right mount options to tell systemd that there should be a timeout after which remote-fs.target is reached so that boot can continue. I don’t know off hand what those options might be but I will investigate.

Meanwhile you need to provide more information - when you say Kodi does not load, does it just stay on the OSMC splash screen, or does some text start overwriting the splash screen - if so, please provide a photo of what it says.

Are you able to log into SSH while it is in this state ? If so please provide the output of the following command while Kodi is failing to load:

sudo journalctl | paste-log


sudo systemctl status | paste-log