Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 60027

Summary: NFS init script - exportfs waits too long - patch.
Product: Gentoo Linux Reporter: MAL <mal>
Component: Current packagesAssignee: Network Filesystems <net-fs>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: /etc/init.d/nfs

Description MAL 2004-08-10 23:19:53 UTC
The current init scripts sleep for 30 seconds (by default), for NFS to export it's directories.

On systems that need it, this pause is due to exportfs doing DNS lookups (either hostname or reverse IP), on each line in the /etc/exports file.  It really isn't necessary for the boot process to wait through this.

It is my opinion that if exportfs is going to choke on any erraneous situations, they are going to be immediately after it is run (broken /etc/exports, no kernel module, etc.).  So I have written this patch to make /etc/init.d/nfs behave differently:

1) Starts exportfs in the background, but in a way that outputs it's exit code to /tmp/exportfs.status
2) Sleeps for 2 seconds (good for slow systems, maybe use the EXPORTFSTIMEOUT as the time to sleep, as it's now unused in my script).
3) Checks whether /tmp/exportfs.status exists and contains a bad exit code.  If so, fail init script.
4) Otherwise continue, letting exportfs resolve DNS in the background.

If people have worries such as "What if my 464th export fails?", we could always log the output of exportfs (after the timeout), to a log file or syslog.

If EXPORTFSTIMEOUT isn't reused, it should be removed.

Reproducible: Always
Steps to Reproduce:




diff'd against nfs-utils 1.0.6-r4
Comment 1 MAL 2004-08-10 23:20:56 UTC
Created attachment 37196 [details, diff]
/etc/init.d/nfs

Patch to the nfs-utils 1.0.6-r4 init script.
Comment 2 SpanKY gentoo-dev 2004-10-07 20:23:14 UTC
i dont understand what this does for anyone

if you dont like the 30 second limit, set it to 2

if i missed something, feel free to re-open and elaborate a bit more why this is any better than not just setting EXPORTFSTIMEOUT=2