The init script for autofs does check for a local auto-master file in /etc before asking the NIS server. This is against the usual philosophy that NIS maps take precedence over local files. Additionally if the map from the NIS server is used the script assumes map-type 'yp' as default what makes it impossible to mix local and NIS maps. Included is a patch that moves the NIS maps to the front of the script and additionally checks if the found auto.master map contains any maps that begin with a slash, then assuming that a local map is wanted, setting the map type to 'file'. --- rc.d/init.d/autofs.orig Mon Sep 20 17:13:32 1999 +++ rc.d/init.d/autofs Sat Oct 16 19:20:35 1999 @@ -37,6 +37,36 @@ function getmounts() { # +# Next to check for YellowPage maps to be loaded +# + if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt 0 ] + then + ypcat -k auto.master | ( + while read dir map options + do + if [ ! -z "$dir" -a ! -z "$map" \ + -a x`echo "$map" | cut -c1` != 'x-' ] + then + map=`echo "$map" | sed -e 's/^auto_/auto./'` + if echo $options | grep -- '-t' >/dev/null 2>&1 ; then + mountoptions="--timeout $(echo $options | \ + sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')" + fi + options=`echo "$options" | sed -e ' + s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g + s/\(^\|[ \t]\)-/\1/g'` + if [ x`echo "$map" | grep '^\/'` != 'x' ] + then + type="file" + else + type="yp" + fi + echo "/usr/sbin/automount $mountoptions $dir $type $map $options $localoptions" + fi + done + ) +else +# # Check for local maps to be loaded # if [ -f /etc/auto.master ] ; then @@ -87,30 +117,6 @@ ;; esac unset basecommand - fi - done - ) -else -# -# Next to check for YellowPage maps to be loaded -# - if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt 0 ] - then - ypcat -k auto.master | ( - while read dir map options - do - if [ ! -z "$dir" -a ! -z "$map" \ - -a x`echo "$map" | cut -c1` != 'x-' ] - then - map=`echo "$map" | sed -e 's/^auto_/auto./'` - if echo $options | grep -- '-t' >/dev/null 2>&1 ; then - mountoptions="--timeout $(echo $options | \ - sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')" - fi - options=`echo "$options" | sed -e ' - s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g - s/\(^\|[ \t]\)-/\1/g'` - echo "/usr/sbin/automount $mountoptions $dir yp $map $options $localoptions" fi done )
*** This bug has been marked as a duplicate of 6484 ***