I think I'm having a little more success with this. In lookup_program.c, you
seem to have changed the way an expecting output of a program looks like. In
version 3, output like this was acceptable:
<machine>:<path>

Where I guess it was the last directory name of <path> that was used for
mounting on the chosen path for that map. Your version of lookup_program.c
seems to require an output similar to that found in a file-type map (<key>
<machine>:<path>) where <key> is used as the name of the directory mounted.
When I changed my program to output the key as well as the resolved
machine/path from 'ypwhich', the program worked fine.

Was this the desired behaviour change for executable maps?

Brian

-----Original Message-----
From: Jeremy Fitzhardinge [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 27, 2000 4:11 PM
To: Brian Favela
Cc: [EMAIL PROTECTED]
Subject: RE: Autofs Programs



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

Reply via email to