OSMC alpha 4 mount nfs after openvpn comes up

I got a problem with my OSMC Alpha 4 running on a PI2.

On my other Kodi machine (Intel Nuc) running kodibuntu, I’m using an upstart job to keep track on when to mount my remote nfs mounts. I need them to mount after my tunnel comes up, not necessarily after the openvpn client job have started. Tis is working fine on the ubuntu based kodi with a conf file /etc/init/mount-nfs.conf. This is not working on now on OSMC, due to the lack of upstart support.

Any suggestions on how I can solve this? How can I port this to systemd?

mount NFS share after our tunnel is up

start on net-device-added INTERFACE=tun0
stop on net-device-removed INTERFACE=tun0

pre-start script
/bin/mount /media/Movies
end script

pre-stop script
/bin/umount /media/Movies
end script

Thanks for a great software that keeps getting better.

Hi there

It was way simpler than I imagined, first I moved my shares from /media to /mnt (works fine on Kodibuntu but NOT on OSMC since they clear the media directory on reboot)

After that I used the suggested mount options (I added soft and removed intr since that is depreciated since kernel 2.6.25) and now it’s working. A reboot worked fine since osmc managed to umount the shares before rebooting. I have tried a few reboots and it’s working 8 times out of 10, you have to be patient since it takes about 30 seconds after the last line is showed on screen

/etc/fstab

192.168.10.24:/mnt/stripe/video /mnt/Movies nfs ro,x-systemd.automount,noauto,soft,udp,cto,noatime,nfsvers=3 0 0
192.168.10.24:/mnt/stripe/musik /mnt/Musik nfs ro,x-systemd.automount,noauto,soft,udp,cto,noatime,nfsvers=3 0 0