I have two servers: a NAS and a client server. They are both small machines (Raspberry, OLinuXino) and are plugged to the same power strip (which has a power button).
The client server mounts the NFS volumes from NAS at startup.
When I switch on the power strip, both servers startup at the same time. But at the time the client tries to mount NFS volumes, they are not yet available from the NAS.
So I have to mount them manually and I want to automate this.
I use fstab to mount the volumes on a Debian Wheezy distribution.
nas.local:/media/myshare /media/myshare nfs defaults 0 0
How I would solve it
So I thought I could add a script on the NAS that calls a ssh command to tell the client "mount your NFS volumes, they are ready now !".
ssh -i idFile login@clientServer 'sudo mount -a' from the NAS side.
What would be the best place where to put that kind of script ?
A NFS hook ? Something like a callback ?
Or is there another and better way to do this ?