autostart nfs server

Asked by Gerlof Brinck

Hello,
I hope someone can help me out on the next problem:
I have a small network all linux computers. My desktop running on Ubuntu 14.04. In the past i had problems with the communication over the network (i used samba) between the linux computers. So I switched to NFS. My Desktop computer as the server and my laptop as the client. It works fantastic, only one problem, then I have started my desktop I have to start up the NFS server (sudo /etc/init.d/nfs-kernel-server start) in the terminal venster and I have to mount my laptop to my desktop (sudo mount 192.xxx.xxx.xx:/home/media/nfsserver) in the terminal venster of my laptop.

Where I'am looking for is that when I start my desktop the NFSserver will start automaticly and when I start my laptop it will mount automaticly to the nfsserver.

I hope someone can help me out on this one.

Thanks beforehand

Gerlof.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Run:
sudo gedit /etc/rc.local

add this line above the 'exit 0' line in the file:
/etc/init.d/nfs-kernel-server start &

Save the new files, close gedit and reboot. It will then run at boot and make things ok.

Revision history for this message
Gerlof Brinck (brinck) said :
#2

Thanks for the help for running the server!

I hope you can help me also out on the last part of my question:

I have to mount my laptop to my desktop (sudo mount 192.xxx.xxx.xx:/home/media/nfsserver) in the terminal venster of my laptop.

It would be very nice if the laptop will start the mounting also automaticly.

Thanks beforehand

Gerlof.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Put the mount command in the rc.local file in the same place on the client. If it doesn't work we can make a small script to work around slow network settings

Revision history for this message
Gerlof Brinck (brinck) said :
#4

Thanks!!

It works.

Kindly regards

Gerlof.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

It's an old bug where the service starts before the network has time to come up so it stops. Same with the client, server cannot be reached as the fstab has been processed before the network is up. This is a good work around.

Revision history for this message
Gerlof Brinck (brinck) said :
#6

Thanks for the explanation.

Now I can also connect the linux computer of my wife and my son to the server.

Regards

Gerlof.

Revision history for this message
Gerlof Brinck (brinck) said :
#7

I have a question:

The here above works fine except for my new computer running on Ububtu 14.04 LTS. My other computer in my room also Ubbuntu 14.04 is the nfsserver and start automaticly perfect. Also my two Mint computers as a cli"ent are working fine. After startin up I can go the the nfsserver and work.

Not the new computer. By hand ok'e but not automaticly.

The rc local is:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sudo mount 192.168.178.29:/home /media/nfsserver
exit 0

Did I miss something ore have I forgotten something?

Hope to hear from you.

Kindly Regards

Gerlof.

Revision history for this message
Launchpad Janitor (janitor) said :
#8

This question was expired because it remained in the 'Open' state without activity for the last 15 days.