yes, I had the same problem.

using "/etc/auto.net" as a guide, I discovered that
you need to return (key,mount) pairs.

autofs3 only required the mount.
below is a simple example.

-Russ

#!/bin/sh

LOG=/tmp/`basename $0`.log
touch $LOG

key=$1; shift

MAPS="auto.home.eng auto.home.sales auto.home.marketing"

for mm in $MAPS
do
        mount=`ypcat $mm | grep "/${key} *\$"`
        status=$?
        if [ $status -eq 0 ]; then
                echo FOUND $key in $mm >> $LOG
                echo "$key      $mount"
                exit 0
        fi
done

echo FAILED TO FIND $key in $MAPS >> $LOG
exit 1

At 11:51 AM -0800 3/27/00, Brian Favela wrote:
>I have an autofs program that I've been using with autofs (v3). When I
>upgraded to autofs v4, it no longer works. I didn't see any documentation on
>the differences in key type changes for the new version. Has anyone else
>experienced this problem?
>
>My program (simplified) looks like the following:
>
>% cat auto_test
>#!/bin/sh
>
>/usr/bin/ypmatch <key> <map>
>
>%
>
>If I add >& to the end of the line to pipe the output to a file, it returns
>the proper key format (<machine>:<path>), but when looking at
>/var/log/messages, automount complained about "lookup(program): lookup for
><key> failed", but I know that the key exists.
>
>Any help would be appreciated, thanks!
>Brian



Reply via email to