On 27-Mar-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?
It should be compatible, but I have to admit I didn't test it.
> 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.
There's two ways in which a lookup script can fail: one is if it exits with a
non-zero exit code, and the other is if it makes no output on stdout. Anything
which comes out stderr is put into the autofs log output. So, to test your
script, make sure you're getting the output on stdout ("auto_test args 2>
/dev/null" should show only your expected output), and make sure the exit status
is OK ("auto_test args ; echo $?" should show 0).
J