LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   NFS works but cannot start at boot automatically (http://www.linuxquestions.org/questions/suse-novell-60/nfs-works-but-cannot-start-at-boot-automatically-801213/)

jsh684 04-10-2010 08:56 AM

NFS works but cannot start at boot automatically
 
I am using SUSE 11.2. And I am really baffled with a strange NFS problem. I hope some experts can help me here.

I have set up the fstab on the client and exports on the server correctly, because if I manually run
# /etc/init.d/nfs start
Starting NFS client services: sm-notify done
I can see and use the NFS partition perfectly, there is no problem at all.

But nfs cannot successfully start at boot. In yast, I have enabled nfs in "System Services (Runlevel)" at runlevel 3 and 5. So it should run automatically, but I always get the following error message:

/var/log/message:
Apr 10 20:07:56 hubble kernel: [ 33.654768] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Apr 10 20:07:56 hubble rpc.statd[2262]: Version 1.1.3 Starting
Apr 10 20:07:56 hubble rpc.statd[2262]: Flags:
Apr 10 20:07:56 hubble rpc.statd[2262]: statd running as root. chown /var/lib/nfs/sm to choose different user
Apr 10 20:07:56 hubble kernel: [ 33.802662] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Apr 10 20:07:56 hubble kernel: [ 33.806946] NFSD: starting 90-second grace period
Apr 10 20:07:56 hubble sm-notify[2271]: Already notifying clients; Exiting!

More info:
# uname -a
Linux hubble 2.6.31.12-0.2-desktop #1 SMP PREEMPT 2010-03-16 21:25:39 +0100 x86_64 x86_64 x86_64 GNU/Linux

Both firewall and AppArmor are disabled.

Can someone help here? Thanks a lot in advance!

smoker 04-10-2010 10:10 AM

There is a discussion that may be useful here :
http://www.mail-archive.com/linux-nf.../msg00361.html

Apparently there is a sm-notify lockfile that isn't being unlocked or removed at shut down

Quote:

> >>> Note the comment in sm-notify.c:
> >>>
> >>> /*
> >>> * Record pid in /var/run/sm-notify.pid
> >>> * This file should remain until a reboot, even if the
> >>> * program exits.
> >>> * If file already exists, fail.
> >>> */
You could test to see if this is the problem by stopping nfs then renaming /var/run/sm-notify.pid to something else (sm-notify.pid.old) then rebooting.

Why it works ok when run manually I don't know ...

jsh684 04-10-2010 11:09 AM

tried: "renaming /var/run/sm-notify.pid to something else (sm-notify.pid.old) then rebooting." And unfortunately the problem stays the same.

More info:

# /etc/init.d/nfsserver status
Checking for kernel based NFS server: mountd running
statd running
nfsd running

# /etc/init.d/nfs status
Checking for mounted nfs shares (from /etc/fstab): unused

# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100021 1 udp 42486 nlockmgr
100021 3 udp 42486 nlockmgr
100021 4 udp 42486 nlockmgr
100021 1 tcp 47237 nlockmgr
100021 3 tcp 47237 nlockmgr
100021 4 tcp 47237 nlockmgr
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100005 1 udp 34530 mountd
100005 1 tcp 47924 mountd
100005 2 udp 34530 mountd
100005 2 tcp 47924 mountd
100005 3 udp 34530 mountd
100005 3 tcp 47924 mountd
100024 1 udp 53925 status
100024 1 tcp 55462 status

so nfs has been started at boot, but it is not actually running unless I manual start the service. I do have proper imports from /etc/fstab, otherwise the manual nfs start would not work.

smoker 04-10-2010 12:00 PM

So what is the actual problem ?
Are you saying that your client machine cannot connect to the nfs share unless you start nfs manually on the server ?

jsh684 04-11-2010 03:45 AM

The problem is: my client machine cannot connect to the nfs share unless I manually run # /etc/init.d/nfs start on the client machine. nfsserver is running fine on the server.

smoker 04-11-2010 07:02 AM

So this has nothing at all to do with the server.

You shouldn't be running nfs as a service on the client.
I suggest you change your fstab file on the client machine.

You say it is correct but you have never posted it.
If everything in fstab gets mounted before your network is initialised, then obviously you can't mount a remote directory.

you should have nfs-common installed on the client, that is all. You don't have to have anything running at boot time. nfs is a program that provides client services, it's not for running on the client.

I suggest you read this thread :
http://www.linuxquestions.org/questi...t-boot-323637/

I also suggest you uninstall whatever nfs related things you installed on your client machine, then install nfs-common. You do not have to add things to the start up.

Finally, I would suggest that when you have 2 machines involved in a problem, you actually tell people what commands and what errors are found on which machine.


All times are GMT -5. The time now is 07:11 AM.