All of lore.kernel.org
 help / color / mirror / Atom feed
* Autofs wrongly tries to use NFS for a program map
@ 2006-03-29 18:13 Mi
  2006-03-29 19:38 ` Jeff Moyer
  0 siblings, 1 reply; 4+ messages in thread
From: Mi @ 2006-03-29 18:13 UTC (permalink / raw)
  To: autofs

Hello,

I'm trying to use a program map for external Firewire drives, but autofs 
seems to think it's supposed to be a NFS map, and fails.

I simplified things to a minimum to show the problem.
/etc/auto.test1 is a normal map which works.
/etc/auto.test2 is a program map which outputs the exact same content as 
is in auto.test1, yet it fails:

    # grep test /etc/auto.master
    /test1           /etc/auto.test1 --timeout=60
    /test2           /etc/auto.test2 --timeout=60

    # cat /etc/auto.test1
    sdb7         -fstype=ext3                        :/dev/sdb7

    # cat /etc/auto.test2
    #!/bin/bash
    echo "sdb7         -fstype=ext3                        :/dev/sdb7"


The test2 program fails:

    # ls /test2/sdb7
    ls: /test2/sdb7: No such file or directory

While test1 works as expected:

    # ls /test1/sdb7
    lost+found

The error in /var/log/daemon.log shows the mount is wrongly attempted as 
an nfs mount:

    Mar 29 18:37:36 gc automount[22081]: mount(nfs): host sdb7: lookup 
failure
    Mar 29 18:37:36 gc automount[22081]: >> mount: directory to mount 
not in host:dir format
    Mar 29 18:37:36 gc automount[22081]: mount(nfs): nfs: mount failure 
sdb7 on /test2/sdb7
    Mar 29 18:37:36 gc automount[22081]: failed to mount /test2/sdb7


# automount -V
Linux automount version 4.1.4_beta2

# uname -a
Linux gc 2.6.8-2-686 #1 Tue Aug 16 13:22:48 UTC 2005 i686 GNU/Linux



Thanks fo any help.

MI

PS: In case you are curious why I want a program map for an external 
drive, it is to be able to wake a sleeping drive. See 
http://sourceforge.net/mailarchive/forum.php?thread_id=10069902&forum_id=5389 
for details.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Autofs wrongly tries to use NFS for a program map
  2006-03-29 18:13 Autofs wrongly tries to use NFS for a program map Mi
@ 2006-03-29 19:38 ` Jeff Moyer
  2006-03-30  8:59   ` Mi
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Moyer @ 2006-03-29 19:38 UTC (permalink / raw)
  To: Mi; +Cc: autofs

==> Regarding [autofs] Autofs wrongly tries to use NFS for a program map; Mi <mi.lists@alma.ch> adds:

mi> Hello, I'm trying to use a program map for external Firewire drives,
mi> but autofs seems to think it's supposed to be a NFS map, and fails.

mi> I simplified things to a minimum to show the problem.  /etc/auto.test1
mi> is a normal map which works.  /etc/auto.test2 is a program map which
mi> outputs the exact same content as is in auto.test1, yet it fails:

mi>     # grep test /etc/auto.master /test1 /etc/auto.test1 --timeout=60
mi> /test2 /etc/auto.test2 --timeout=60

mi>     # cat /etc/auto.test1 sdb7 -fstype=ext3 :/dev/sdb7

mi>     # cat /etc/auto.test2
mi>     #!/bin/bash echo "sdb7 -fstype=ext3 :/dev/sdb7"

Program maps need not print the "key".  Since the automount daemon already
knows what key it is looking up, this would be redundant information.
Simply get rid of the "sdb7" from the beginning of your echo line and
things should work

-Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Autofs wrongly tries to use NFS for a program map
  2006-03-29 19:38 ` Jeff Moyer
@ 2006-03-30  8:59   ` Mi
  2006-03-30 14:29     ` Jeff Moyer
  0 siblings, 1 reply; 4+ messages in thread
From: Mi @ 2006-03-30  8:59 UTC (permalink / raw)
  To: autofs


> Program maps need not print the "key".  Since the automount daemon already
> knows what key it is looking up, this would be redundant information.
>   
Thanks a lot. Indeed, removing the key form the script output solved the 
problem.


May I suggest adding some details to the autofs.5 man page, in the 
"program" section? The output format expected from an executable map 
doesn't seem to be documented anywhere in the man pages.

I was just a bout to do it and submit a diff for autofs.5, but then I 
realized that I really don't know the format which is expected. For a 
normal map, it would seem to be

[options] :device

But what is the expected format for an NFS map, and what other formats 
can be used?


Thank you,

MI

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Autofs wrongly tries to use NFS for a program map
  2006-03-30  8:59   ` Mi
@ 2006-03-30 14:29     ` Jeff Moyer
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Moyer @ 2006-03-30 14:29 UTC (permalink / raw)
  To: Mi; +Cc: autofs

==> Regarding Re: [autofs] Autofs wrongly tries to use NFS for a program map; Mi <mi.lists@alma.ch> adds:

>> Program maps need not print the "key".  Since the automount daemon
>> already knows what key it is looking up, this would be redundant
>> information.
>> 
mi> Thanks a lot. Indeed, removing the key form the script output solved
mi> the problem.


mi> May I suggest adding some details to the autofs.5 man page, in the
mi> "program" section? The output format expected from an executable map
mi> doesn't seem to be documented anywhere in the man pages.

Yes, this is a good suggestion.

mi> I was just a bout to do it and submit a diff for autofs.5, but then I
mi> realized that I really don't know the format which is expected. For a
mi> normal map, it would seem to be

mi> [options] :device

mi> But what is the expected format for an NFS map, and what other formats
mi> can be used?

A program map uses the same syntax as a file map.  I think something like
the attached should be sufficient.

Thanks,

Jeff

--- autofs/man/autofs.5.orig	2006-03-30 09:23:45.000000000 -0500
+++ autofs/man/autofs.5	2006-03-30 09:27:38.000000000 -0500
@@ -153,7 +153,12 @@ map to the automounter.  A
 .B program
 map will be called as a script with the key as an argument.  It may
 return no lines of output if there's an error, or one or more lines
-containing a map (with \\ quoting line breaks).
+containing a map (with \\ quoting line breaks).  The output from the
+.B program
+map should omit the key;  aside from that, it supports exactly the
+same syntax as a
+.B file
+map.
 .P
 To use a 
 .B program

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-30 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-29 18:13 Autofs wrongly tries to use NFS for a program map Mi
2006-03-29 19:38 ` Jeff Moyer
2006-03-30  8:59   ` Mi
2006-03-30 14:29     ` Jeff Moyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.