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
Created attachment 37196 [details, diff] /etc/init.d/nfs Patch to the nfs-utils 1.0.6-r4 init script.
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