I have a network service that defines a filesystem namespace. I'd like to
write an executable map that uses that service to return map entries to
automount. Abstractly, the executable map takes the namespace path, queries
the web service, and returns a map entry to automount. The map entry is
either a pointer to a real filesystem or an -fstype=autofs entry that causes
the executable map to be executed again when/if an entry in the directory is
touched.

The only hole in this is that the program being executed needs the entire
namespace path (or something with the same information) in order to do the
lookup. The autofs API only gives the map the key, making the context
implicit in the map itself.

Here's an example, if executable maps could take arguments:

Auto.master would have something like

        /net /etc/autofs/nsmap

Then doing a cd /net/a, nsmap would get called with argument a.

Nsmap, not seeing only one argument, would return something like

        -fstype=autofs program:/etc/autofs/nsmap /a

Which would get an automount started on /net/a. Then, doing a 

        Cd /net/a/b

Nsmap would get called with /etc/autofs/nsmap /a b, for which it could
return

        -fstype=autofs program:/etc/autofs/nsmap /a/b

Etc.

Arguably, this isn't the best way to do this since. An alternative would be
to pass some of the options to the executable maps, so you could do
something like

        -fstype=autofs,-ns=/a/b program:/etc/autofs/nsmap

Is this any clearer? Any worse or better an idea?

I could possibly do the same thing if I could wrap the web service in an
LDAP or NIS service. That would have the advantage of not requiring code on
the client. Or, I could add XMLRPC as a map type to automount ... Neither
LDAP nor NIS seem easy to wrap ...



_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to