1

autofs has a auto.master configuration file that assignes maps files to paths, and in these maps files we can define how to mount subdirectories of the paths from auto.master. These subdirectories can be explicit or we can use * which becomes a wildcard(which we can refer to in the mount options using &). Additionally, if we make a maps file executable it will receive that subdirectory as it's first(and only) argument, and be expected to write the mount definition to stdout.

Now, my problem is that I need 2 wildcards/arguments. I want that if someone tries to access /mymount/<foo>/<bar>, where <foo> and <bar> can be any legal file names, it will create a mountpoint on /mymount/<foo>/<bar> to a target that depends on both <foo> and <bar>. My problem is that the I can only use one wildcard(which is <foo>), and with the executable maps file approach the argument I get is just <foo> and I autofs expects me to return mount options that will be mounted on /mymount/<foo>.

Is what I want even possible with autofs? I can easily find docs for a single parameter, but nothing about using multiple parameters...

Idan Arye
  • 115
  • 3

1 Answers1

2

What you might be able to do is have them combined into one, say foo+bar, so it will be one argument, then have the executable map script split on the + and use the results as the two path parts to use. But as far as I know autofs (and really any mounting) only takes one argument for the path to mount on, not two.

lsd
  • 1,673
  • 10
  • 10