Problems with server going into sleep mode

I’m using autofs to access video files in remote NFS shares. This is causing all kinds of problems when the file server goes into sleep mode.

In another thread I’ve inquired about the possibility of autofs sending WOL packets to unresponsive servers, but it doesn’t look like I’m ever going to get a response to that :frowning: so I’m wondering if we could at least mitigate the damage a bit.

There are two principal issues. The first happens when I try to play a video when the server is asleep. I get a message saying the file is no longer available, and do I want to remove it from the library (which I guess is fair enough); but then something seems to cache the fact that the file isn’t there any more, so that even if I manually wake the server up and then try to play the file again, it still says the file is missing and do I want to remove it from the library; I have to reboot the Vero 4K+ to get it to actually look for the file again.

The even more annoying one happens if I pause playback. The server is set to wait for 30 minutes before going into sleep mode, but if it’s been more than 30 minutes since anyone hit the server keyboard or mouse, it will stay awake so long as a file is being actively accessed, but can go into sleep mode quite rapidly if the video is paused and the Vero stops pulling data.

If the server goes to sleep while the video is paused then the Vero locks up so badly that it can’t even be rebooted successfully: the only way to get any any response at all is to connect to it via SSH and instruct it to reboot, but then the reboot process itself locks up (while trying to unmount an unresponsive autofs share, I think) and the only option I’m left with is to power-cycle the Vero.

Obviously the server behaviour isn’t exactly helping here, but surely the Vero shouldn’t be locking up that badly if the video file becomes inaccessible while playback is paused?

EDIT: incidentally, this isn’t only an autofs issue. Even if I’m accessing a file via a Kodi-level NFS source, it will only send a WOL packet when first accessing the source. If the server goes to sleep when playback is paused, it doesn’t send a new WOL packet when you try to resume playback, and you then get the same lock-up issue.

The Vero will keep trying to seek and the filesystem will block and wait for connectivity to be restored, so this is somewhat expected.

I’ve posted a link to a different article in the other thread which should be of some use.

Sam

Yes, but what if connectivity isn’t restored? Your only option is to turn the Vero off at the mains. Surely it ought to allow you to hit the stop button under those circumstances?

Eventually it should time out / reach EOF and bail.

How long would you expect it to take to time out? And can that setting be modified? If it were to give up in 10-15 seconds, this would cease to be a problem; but if it’s going to stay unresponsive for several minutes, that’s more of an issue.

Also, I don’t think you addressed my other issue, which is that if a file is inaccessible, Kodi caches the fact that it’s inaccessible and refuses to look for it again (even when the server is awake) unless you reboot the Vero.

I don’t know – that’d be a part of Kodi that I’ve not particularly dug in to in detail.

This will be autofs or libNFS doing the caching: [kodi] New files inaccessible until reboot - Overzealous file/directory caching? · Issue #257 · sahlberg/libnfs · GitHub.

It might be better to have a script that wakes the NAS depending on specific actions in Kodi. One could assume that if you are navigating the device, you want the NAS shares to be available.

I’m happy to agree with that. Would you care to supply such a script and explain how to employ it? :slight_smile:

The script will depend on your environment.
I suspect using Kodi Callbacks will likely meet your requirements. See https://kodi.wiki/view/Add-on:Kodi_Callbacks