NFS watchdog?
#1
Is there a watchdog for NFS shares? If my server crashes, or gets rebooted, my node RPIs all have to be rebooted to be able to play/see media. I have the standard watchdog addon installed, but it does not seem to fix this problem.
Reply
#2
standard watchdog daemon provides everything needed. you are not specifying what system you run on RPIs, but anything else from OE is providing that daemon.

in your case you could set a

file =
(to watch for)

repair-binary =
(a script waiting for your server be available again)

once server up again, that script returns non 0 and watchdog will reboot.
Reply
#3
(2016-04-15, 02:00)mk01 Wrote: standard watchdog daemon provides everything needed. you are not specifying what system you run on RPIs, but anything else from OE is providing that daemon.

in your case you could set a

file =
(to watch for)

repair-binary =
(a script waiting for your server be available again)

once server up again, that script returns non 0 and watchdog will reboot.

Running OSMC, the RPIs. I will look into doing the script thing, if I can figure it out, hopefully google will point me in the right direction.
Reply
#4
apt-get install watchdog
man watchdog.conf

take look at those parameters i posted - "file =", "repair-binary =", also "test-binary =".

script for test-binary could be like this, also set "test-timeout = 60".
Code:
ls -la /my/mounted/nfs/dir >/dev/null 2>&1

ls -la will try to access directory - if it doesn't exists - watchdog will see it as fialure and normally will reboot. if dir will exists - but server wont respond - for this you set the test-timeout - if within 60 s scripts won't finish, again failure.

and now 2nd part - you dont want immediate reboot - because server can be down hour, day etc, right ? and just with the testing, your RPIs would reboot constantly in loop. so you add "repair-binary = ...."
Code:
while ! ping XXXXX; do
  sleep 1
done

exit 1

so once failure (not accessible dir) happens, watchdog runs "repair" binary - there you are waiting until ping responds (you can also set an timeout). the exit 1 at the end is to "fake" to watchdog a failure while "repairing" situation - so once ping responds, script returns failure and watchdog reboots machine.

and skip google Smile
Reply
#5
(2016-04-15, 06:10)mk01 Wrote: apt-get install watchdog
man watchdog.conf

take look at those parameters i posted - "file =", "repair-binary =", also "test-binary =".

script for test-binary could be like this, also set "test-timeout = 60".
Code:
ls -la /my/mounted/nfs/dir >/dev/null 2>&1

ls -la will try to access directory - if it doesn't exists - watchdog will see it as fialure and normally will reboot. if dir will exists - but server wont respond - for this you set the test-timeout - if within 60 s scripts won't finish, again failure.

and now 2nd part - you dont want immediate reboot - because server can be down hour, day etc, right ? and just with the testing, your RPIs would reboot constantly in loop. so you add "repair-binary = ...."
Code:
while ! ping XXXXX; do
  sleep 1
done

exit 1

so once failure (not accessible dir) happens, watchdog runs "repair" binary - there you are waiting until ping responds (you can also set an timeout). the exit 1 at the end is to "fake" to watchdog a failure while "repairing" situation - so once ping responds, script returns failure and watchdog reboots machine.

and skip google Smile

While your solution seems nice, the NFS shares are not actually mounted like that. When I added the movies from the video menu, i chose NFS share, and went to the share, and added the files. So I was looking for a solution that is built into Kodi, or a Kodi addon. If all else fails, I will use your suggestion.
Reply

Logout Mark Read Team Forum Stats Members Help
NFS watchdog?0