"after portmap" should be added to depend() in /etc/init.d/autofs. The, somewhat obscure, problem is that remote mounts via nfs need portmap running. autofs doesn't need portmap but I think it's common to use it to mount network file systems. There could be a race condition if autofs is loaded, then a service that uses a nfs automounted filesystem will get stuck until portmap is started which could hang the whole init process.
I think it should rather be "use portmap".
I don't have a problem with this as I use autofs for nfs stuff. But people that use autofs to mount floppies or cdroms don't need portmap running. I could argue: If you are setting up nfs it's your job to know what needs to be running and start the right services at boot time. or: Most people will be grateful for not having to think about portmap when setting up autofs to mount stuff via nfs. I think either is valid but the first seems "more" valid.
Recheck what "use portmap" does. It means it "need" portmap, but will only start it before the script that have the line if portmap is added to the boot, or current runleve.
I'll admit I didn't have a proper understanding of "use". After putting much more thought into this than I originally intened to here is an one liner that can be added to depend that checks the autofs config files for the use of nfs and if found makes autofs depend on portmap: grep fstype=nfs `sed -e '/^#/d' -e '/^$/d' /etc/autofs/auto.master | cut -f 2` &>/dev/null && need portmap
Opps, the suggested line to detect if nfs is used uses `cut` which is installed to /usr/bin/cut and /usr may not be mounted at boot time. The following line is close but needs some help to be more general in it's detection of the 2nd field, the following line assumes one tab between the mount point and cfg file: grep fstype=nfs `sed -e '/^#/d' -e '/^$/d' -e 's/^.*\t\(.*\)$/\1/' /etc/autofs/auto.master` &>/dev/null && need portmap
*** Bug 4782 has been marked as a duplicate of this bug. ***
Actually there is another "bug" un the autofs init-script: in depend() are two lines with "need" where only the last is used: need ypbind need net This should be: need net ypbind
*** Bug 7036 has been marked as a duplicate of this bug. ***
I know these bugs are rather old, but I've been assigned to try and solve some of them. I just committed an -r4 of autofs which changes a few things and hopefully helps out. Mainly added a use portmap, and there should be a functional stats option that should funtion like the usual status, as status is already predefined to show if the daemon is running or not.*NOTE that is stats not status. Hopefully some library compile issues are also fixed. Any help with autofs would be appreciated because I myself have only used it to check on these bugs and see how it functions, maily because I have no real use for it. Please contact me with any improved scripts or changes you have made. Thanks