Using wildcards in multi-mount maps
Hi,
are wildcards within multi-mount maps supposed to work?
I have the following entry in our maps:
/etc/auto.master (local):
/mymount yp:mymap --ghost
Indirect NIS map for /mymount:
$ ypmatch webapps mymap /* -timeo=30 server:/local/exports/& $
On the NIS server the map looks like this:
webapps \
/* -timeo=30 server:/local/exports/&However on the client it looks like:
$ ls /mymount/webapps * $ ls /mymount/webapps/user ls: /mymount/webapps/user: No such file or directory $
(/local/exports/user /is/ exported to this client from server)
This is on CentOS 5 with autofs 5.0.1.
Should that work or do I have to solve this mount config in an other way?
Frank
Ian Kent
maintainerQuoted 3 lines · Frank Thommen
Hi,
are wildcards within multi-mount maps supposed to work?
Good question.
Quoted 10 lines
I have the following entry in our maps:
/etc/auto.master(local):/mymount yp:mymap --ghostIndirect NIS map for /mymount:
$ ypmatch webapps mymap /* -timeo=30 server:/local/exports/&
Yeah, that can't work.
The wildcard must be a single character at the start of the key, no other characters can be used.
So, no that can't be used in multi-mount map entries.
Keep in mind that for multi-mount map entries to work the offset paths must be known when the containing mount is performed so adding functionality like this isn't actually doable.
The substitution is based on replacing the whole key, autofs can't take part of a key and use it for substitution either.
What's more doing so would introduce the the need to handle multiple occurrences of the wildcard with matching of where to substitute each one and that isn't covered by the Sun map format AFAIK.
If this type of extended key pattern matching is really needed you could have a look at the amd map format. I haven't implemented the regex key matching functionality of am-utils in autofs but the variable length key matching combined with wildcard entries might be sufficient.
Note that I also haven't implemented the am-utils multi-mount like map type either and the way they are specified in amd map format maps doesn't lend itself to this sort of wildcard handling either.
Quoted 28 lines
$On the NIS server the map looks like this:
webapps \ /* -timeo=30 server:/local/exports/&However on the client it looks like:
$ ls /mymount/webapps * $ ls /mymount/webapps/user ls: /mymount/webapps/user: No such file or directory $(/local/exports/user /is/ exported to this client from server)
This is on CentOS 5 with autofs 5.0.1.
Should that work or do I have to solve this mount config in an other way?
Frank
--
To unsubscribe from this list: send the line "unsubscribe autofs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Ian Kent
maintainerQuoted 32 lines · Ian Kent
Quoted 3 lines · Frank Thommen
Hi,
are wildcards within multi-mount maps supposed to work?
Good question.
Quoted 10 lines
I have the following entry in our maps:
/etc/auto.master(local):/mymount yp:mymap --ghostIndirect NIS map for /mymount:
$ ypmatch webapps mymap /* -timeo=30 server:/local/exports/&Yeah, that can't work.
The wildcard must be a single character at the start of the key, no other characters can be used.
So, no that can't be used in multi-mount map entries.
Keep in mind that for multi-mount map entries to work the offset paths must be known when the containing mount is performed so adding functionality like this isn't actually doable.
The substitution is based on replacing the whole key, autofs can't take part of a key and use it for substitution either.
Quoted 8 lines
What's more doing so would introduce the the need to handle multiple occurrences of the wildcard with matching of where to substitute each one and that isn't covered by the Sun map format AFAIK.
If this type of extended key pattern matching is really needed you could have a look at the amd map format. I haven't implemented the regex key matching functionality of am-utils in autofs but the variable length key matching combined with wildcard entries might be sufficient.
That probably should read "multiple component key matching" rather than "variable length key matching".
Quoted 11 lines
Note that I also haven't implemented the am-utils multi-mount like map type either and the way they are specified in amd map format maps doesn't lend itself to this sort of wildcard handling either.
Quoted 6 lines
$On the NIS server the map looks like this:
webapps \ /* -timeo=30 server:/local/exports/&
The other approach that might be useful is using submounts (Sun map format) like:
webapps -fstype=autofs autofs.wild
where autofs.wild could contain:
other-offset-submount -fstype=autofs autofs.other-offsets
* -timeo=30 server:/local/exports/&
and the map autofs.other-offsets is a subdirectory of lower level mounts. Obviously you would need one of these for each sub directory of mounts.
Quoted 28 lines
Quoted 14 lines
However on the client it looks like:
$ ls /mymount/webapps * $ ls /mymount/webapps/user ls: /mymount/webapps/user: No such file or directory $(/local/exports/user /is/ exported to this client from server)
This is on CentOS 5 with autofs 5.0.1.
Quoted 8 lines
Should that work or do I have to solve this mount config in an other way?
Frank
--
To unsubscribe from this list: send the line "unsubscribe autofs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe autofs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 28 lines · Ian Kent
Quoted 14 lines · Ian Kent
Quoted 3 lines · Frank Thommen
Hi,
are wildcards within multi-mount maps supposed to work?
Good question.
Quoted 7 lines
I have the following entry in our maps:
/etc/auto.master(local):/mymount yp:mymap --ghostQuoted 7 lines
Quoted 3 lines
Indirect NIS map for /mymount:
$ ypmatch webapps mymap /* -timeo=30 server:/local/exports/&Yeah, that can't work.
[...]
The other approach that might be useful is using submounts (Sun map format) like:
webapps -fstype=autofs autofs.wild
Quoted 7 lines
where autofs.wild could contain:
other-offset-submount -fstype=autofs autofs.other-offsets
* -timeo=30 server:/local/exports/&and the map autofs.other-offsets is a subdirectory of lower level mounts. Obviously you would need one of these for each sub directory of mounts.
Solved it this way. Thanks a lot
Frank