Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NFS export problem [RESOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Wed Sep 15, 2004 12:39 pm    Post subject: NFS export problem [RESOLVED] Reply with quote

I recently emerged the new version of dhcpcd which went into x86 stable. However, when I restarted all the network services I got an error when exporting NFS directories:
Code:
 * Stopping NFS mountd...                                                 [ ok ]
 * Stopping NFS daemon...                                                 [ ok ]
 * Stopping NFS statd...                                                  [ ok ]
 * Starting NFS statd...                                                  [ ok ]
 * Exporting NFS directories...
/sbin/runscript.sh: line 534:  9259 Killed                  $exportfs -r 1>&2
 * Error exporting NFS directories                                        [ !! ]

 * Starting NFS daemon...                                                 [ ok ]
 * Starting NFS mountd...                                                 [ ok ]
Needless to say, none of the directories are actually exported and no one can mount them. Line 534 of /sbin/runscript.sh is the very last line of the script, so that didn't help much.

I looked in /var/log/messages, and this error was reported:
Code:
Sep 15 13:26:36 Commodore64 rpc.mountd: Caught signal 15, un-registering and exiting.
Sep 15 13:26:36 Commodore64 nfsd: last server has exited
Sep 15 13:26:36 Commodore64 nfsd: unexporting all filesystems
Sep 15 13:26:36 Commodore64 rpc.statd[8850]: Caught signal 15, un-registering and exiting.
Sep 15 13:26:36 Commodore64 rpc.statd[9256]: Version 1.0.6 Starting
Sep 15 13:26:36 Commodore64 rpc.statd[9256]: gethostbyname error for Commodore64
Sep 15 13:27:06 Commodore64 rc-scripts: Error exporting NFS directories
Sep 15 13:27:06 Commodore64 svc: bad direction 65536, dropping request
Sep 15 13:27:06 Commodore64 svc: bad direction 65536, dropping request

I did a google search on "gethostbyname error" but nothing interesting turned up. Before I try downgrading dhcpcd, does anyone have any ideas on how I get this up and running again?


Last edited by chunderbunny on Thu Sep 23, 2004 12:17 pm; edited 2 times in total
Back to top
View user's profile Send private message
Nossie
Apprentice
Apprentice


Joined: 19 Apr 2002
Posts: 181

PostPosted: Wed Sep 15, 2004 12:59 pm    Post subject: Reply with quote

it seems your system map it's own name to a ipnumber with the funcion 'gethostbyname'

Do you have an entry in /etc/hosts ?

[edit]
ehh, i meant /etc/hosts instead of /etc/host :oops:
[/edit]


Last edited by Nossie on Wed Sep 15, 2004 1:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
hecatomb
Guru
Guru


Joined: 02 Sep 2004
Posts: 525

PostPosted: Wed Sep 15, 2004 1:08 pm    Post subject: Reply with quote

Maybe you have not recieved a new ip-adress after the dhcpd update.

Code:
/etc/init.d/net.eth0 restart
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Wed Sep 15, 2004 1:12 pm    Post subject: Reply with quote

Nope, /etc/host is empty. What is supposed to be in there?

And yes, I am getting an IP address. All other network services are up and running (ntp, ssh, etc.)

Edit: BTW, in case you meant /etc/hosts, that looksl ike this
Code:
127.0.0.1   localhost

# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

And /etc/hostname is
Code:
Commodore64
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Wed Sep 15, 2004 1:23 pm    Post subject: Reply with quote

Ok, I changed my /etc/hosts to this:
Code:
127.0.0.1       Commodore64.retro Commodore64 localhost

# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


And now the "gethostsbyname error" message doesn't appear when i try and restart NFS, but... it still doesn't export any directories. I'm still getting the error
Code:
/sbin/runscript.sh: line 534: 10059 Killed                  $exportfs -r 1>&2
 * Error exporting NFS directories                                        [ !! ]

And the message
Code:
Sep 15 14:18:31 Commodore64 rpc.mountd: Caught signal 15, un-registering and exiting.
Sep 15 14:18:31 Commodore64 nfsd: last server has exited
Sep 15 14:18:31 Commodore64 nfsd: unexporting all filesystems
Sep 15 14:18:31 Commodore64 rpc.statd[9812]: Caught signal 15, un-registering and exiting.
Sep 15 14:18:31 Commodore64 rpc.statd[10056]: Version 1.0.6 Starting
Sep 15 14:19:01 Commodore64 rc-scripts: Error exporting NFS directories
Sep 15 14:19:02 Commodore64 svc: bad direction 65536, dropping request


Anything else?
Back to top
View user's profile Send private message
hecatomb
Guru
Guru


Joined: 02 Sep 2004
Posts: 525

PostPosted: Wed Sep 15, 2004 1:35 pm    Post subject: Reply with quote

I found this in the startscript:

Code:
...
   # Exportfs likes to hang if networking isn't working.
   # If that's the case, then try to kill it so the
   # bootup process can continue.
...


Are you sure your network connection is ok? ping some other hosts to test this.
Maybe the NFS servers hostname is also missing in your /etc/hosts?
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Wed Sep 15, 2004 1:45 pm    Post subject: Reply with quote

Networking is definitely working, I'm administering this machine through an SSH connection. ;)

The machine with the trouble IS the NFS server, it's not exporting directories. I don't need a special entry in /etc/hosts for this.

Edit: Ok, this is interesting. If I change my /etc/exports so that I'm only exporting one directory, then it all works fine. With two entries in /etc/exports then it fails. It doesn't matter which entry I use either...
Back to top
View user's profile Send private message
hecatomb
Guru
Guru


Joined: 02 Sep 2004
Posts: 525

PostPosted: Wed Sep 15, 2004 1:59 pm    Post subject: Reply with quote

Sorry, didn't get the point (Commodore64 IS the NFS Server)!
This is strange, exporting one dir is ok but two fail. No idea!
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Wed Sep 15, 2004 2:50 pm    Post subject: Reply with quote

I upgraded nfs-utils to ~x86, but that hssn't changed anything. I can still only export one NFS directory at a time.
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Thu Sep 16, 2004 11:01 pm    Post subject: Reply with quote

Bump, I'm still not getting anywhere. Only 1 directory can be exported at a time without NFS throwing up an error.
Back to top
View user's profile Send private message
hecatomb
Guru
Guru


Joined: 02 Sep 2004
Posts: 525

PostPosted: Fri Sep 17, 2004 7:06 am    Post subject: Reply with quote

Maybe the output of exportfs will help.

I have no NFS so this is just a guess. The daemon will be started with a script like every other too. Find the script (e.g.)

Code:
find /etc -exec grep "Error exporting NFS directories" {} /dev/null \;


Then make a backup and edit this file:

Code:
...
ebegin "Exporting NFS directories"
$exportfs -r 1>&2 &
pid=$!
( sleep 30; kill -9 $pid &>/dev/null ) &
wait $pid
eend $? "Error exporting NFS directories"
...


edit these lines so that the command exportfs will NOT be killed after 30 seconds:

Code:
...
ebegin "Exporting NFS directories"
$exportfs -r
# pid=$!
# ( sleep 30; kill -9 $pid &>/dev/null ) &
# wait $pid
eend $? "Error exporting NFS directories"
...


Or maybe you can execute the command by yourself.

Code:
(/usr/sbin/)exportfs -r


Hope you will get some interesting messages!
Back to top
View user's profile Send private message
barnie
n00b
n00b


Joined: 04 Jul 2003
Posts: 21

PostPosted: Wed Sep 22, 2004 11:45 pm    Post subject: Solved Reply with quote

I had the same problem. Running exportfs -r sepearte solved it. So I increased the time in the script. Now everything is working.
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Wed Sep 22, 2004 11:50 pm    Post subject: Reply with quote

Which script did you edit to increase the time?
Back to top
View user's profile Send private message
sf_alpha
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2002
Posts: 136
Location: Bangkok, TH

PostPosted: Thu Sep 23, 2004 2:52 am    Post subject: Reply with quote

May be portmap problems ... Checkit ?
_________________
Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th
Back to top
View user's profile Send private message
hecatomb
Guru
Guru


Joined: 02 Sep 2004
Posts: 525

PostPosted: Thu Sep 23, 2004 5:45 am    Post subject: Reply with quote

Quote:
Which script did you edit to increase the time?


I think he means the startscript /etc/init.d/nfs

Code:
...
ebegin "Exporting NFS directories"
$exportfs -r 1>&2 &
pid=$!
( sleep 30; kill -9 $pid &>/dev/null ) &
wait $pid
eend $? "Error exporting NFS directories"
...


Increase the 30 sec. the script is waiting for the end of exportfs. Maybe this will help!
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Thu Sep 23, 2004 12:17 pm    Post subject: Reply with quote

Cool, thanks that worked! :D

Well, not exactly, the script is a little different in my version (it has a seperate waitfor_exportfs function) but the general principle is the same.
Back to top
View user's profile Send private message
richardash1981
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2005
Posts: 94
Location: England

PostPosted: Fri Nov 11, 2005 10:18 pm    Post subject: Reply with quote

Your problem is waiting for network name resolution for the _clients_ to time out. You must be able to reverse DNS each client from the server (try running dig there).

The nfs server needs to be able to do a reverse DNS lookup on each client IP that tries to connect to it,(even with IP addresses or masks in /etc/exports). If it can't, mount will often time out on the clients, and exportfs will take much longer.
Either add the nfs clients to the DNS or the server's hosts file.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum