Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 60027 - NFS init script - exportfs waits too long - patch.
Summary: NFS init script - exportfs waits too long - patch.
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Network Filesystems
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-10 23:19 UTC by MAL
Modified: 2004-10-07 20:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/init.d/nfs (nfs,1.42 KB, patch)
2004-08-10 23:20 UTC, MAL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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