Skip to contentSkip to conversation

questions on auto.master file format

DISCUSSION Jeff Moyer 4 participants 9 messages Mar 2, 2004 – Mar 4, 2004 Kernel automounter

lore
Share & tools
lore

Jeff Moyer

author
#0 lore raw

Hello,

Reading through Sun's documentation, it seems that mount options specified in auto.master should begin with a leading dash. See the example here:
http://docs.sun.com/db/doc/816-0211/6m6nc66nc?q=automount&a=view

Is this something we want to be compatible with? I suppose we could invert the meaning of the - in auto.master, but that could break a whole lot of people. :(

Next, from the auto.master man page:

Options are cumulative, which is a difference from the behavior of the SunOS automounter.

If there is a conflict between the options specified in auto.master and the map file, which one takes precedence? I looked through the code briefly, and it seems to be unhandled. Did I miss something?

Thanks!

-Jeff

author
#2 lore raw

==> Regarding Re: [autofs] questions on auto.master file format; Ian Kent <[email protected]> adds:

Quoted 5 lines · Jeff Moyer
Quoted 5 lines

Hello,

Reading through Sun's documentation, it seems that mount options specified in auto.master should begin with a leading dash. See the example here:

http> //docs.sun.com/db/doc/816-0211/6m6nc66nc?q=automount&a=view

raven> What makes you think that? Looks like the options are for the raven> automounter not mount.

,----

| # Master map for automounter
| #
| +auto_master
| /net          -hosts    -nosuid
| /home         auto_home
| /xfn          -xfn
| 
| Optional mount options may be supplied as an optional third field in the
| each entry.

`----

Have I misinterpreted this? Looks to me like nosuid is a mount option.

Thanks!

Jeff

maintainer
#3 lore raw
Quoted 23 lines · Jeff Moyer

==> Regarding Re: [autofs] questions on auto.master file format; Ian Kent <[email protected]> adds:

Quoted 5 lines · Jeff Moyer
Quoted 5 lines

Hello,

Reading through Sun's documentation, it seems that mount options specified in auto.master should begin with a leading dash. See the example here:

http> //docs.sun.com/db/doc/816-0211/6m6nc66nc?q=automount&a=view

raven> What makes you think that? Looks like the options are for the raven> automounter not mount.

,----

| # Master map for automounter
| #
| +auto_master
| /net          -hosts    -nosuid
| /home         auto_home
| /xfn          -xfn
| 
| Optional mount options may be supplied as an optional third field in the
| each entry.
Quoted 3 lines

`----

Have I misinterpreted this? Looks to me like nosuid is a mount option.

Oops. My mistake.

Ian

#4 lore raw
Quoted 4 lines
Quoted 2 lines

Have I misinterpreted this? Looks to me like nosuid is a mount option.

Oops. My mistake.

But you're relying on Sun's documentation :-) We don't use the options like they document, but our auto_master is in NIS+:

/auto /etc/auto.indirect -grpid
/users auto_home -rw,hard,intr

Before implementing this feature, I'd much prefer to see layered direct mounts ;-)

/Brian/

Signature · 4 lines
       Brian Long                      |         |           |
       Americas IT Hosting Sys Admin   |       .|||.       .|||.
       Cisco Linux Developer           |   ..:|||||||:...:|||||||:..
       Phone: (919) 392-7363           |   C i s c o   S y s t e m s
maintainer
#5 lore raw
Quoted 3 lines · Brian Long

Before implementing this feature, I'd much prefer to see layered direct mounts ;-)

You would be talking about cross filesystem mounts?

#6 lore raw

Sorry, same request I asked about in a previous thread. The ability to have an /etc/auto.direct map like this:

/netapp/tonka           /               tonka:/vol/root \
                        /vol/vol1       tonka:/vol/vol1 \
                        /vol/vol2       tonka:/vol/vol2 \
                        /vol/vol3       tonka:/vol/vol3

The auto_master on Solaris has this:
+auto_master
/- /etc/auto.direct

/Brian/

#7 lore raw

Request for Sun-like hosts map

While we're discussing features that people would like: Here at UCLA-Mathnet we have over 100 machines which export various filesystems to random other machines on an "as needed" basis. On Solaris, /etc/auto_master includes a line:

/net -hosts -nosuid,nobrowse

which means that if a user refers to /net/tupelo/h1/maint/jimc (for example), the toplevel automounter process will fork a submount for /net/tupelo, and that one will attempt to mount tupelo:/h1.

To emulate this on Linux, I do (or the startup script does) "automount /net program /etc/auto.net", where the program map is a cockamamie script I wrote which creates a map file saying

* tupelo:/&

in a special directory, and then exudes

-rsize=8192,wsize=8192,retry=1,soft,fstype=autofs file:/rete/tupelo

so that the submount will get the newly created map file. It also purges map files that are no longer in use. This latter part is nasty and risky.

Automating this script would be really nice. In the current Sun approach, the whole thing is just assumed for a host map. Here's a somewhat more configurable proposal for Linux:

There would be a new map type of, well, what's a reasonable name for it? "macro". The second field of the map row would be "macro:(the literal content of the map)", as if read from a file. Since it contains whitespace, it must be enclosed in (parens). (Not quotes, because you need nested quoting, and it's too hard to determine the polarity of imbedded quotes.)

Backslash should escape any character, in the sense that backslash-anything (except newline?) turns into the "anything" character and magic semantics is bypassed. In particular, & and $ and a second backslash would have their magic concealed. To have a control character interpreted at the n-th level you need (2^n)-1 backslashes. (Since parens are nested, it doesn't matter whether you put backslashes on them or not.)

For example, the host map could be represented in /etc/auto.master as:

    /net macro:(* macro:(* &:/\&)) -fstype=autofs,other_options

Upon access to /net/tgthost/filesys, the first ampersand is expanded to the toplevel key (target host name), producing a submount, which thinks its map file says:

* macro:(* tgthost:/&) -other_options

Then when the submount sees the request it expands its macro into a map line like this, with & replaced by the key from the request:

* tgthost:/filesys -other_options

which is exactly what you need to get the job done.

Since lines can get long in automount maps, particularly macro lines, and since we have to work on backslashes anyway, this might be a nice time to put in backslash-newline escapes. The rule would be to completely ignore backslash-newline-whitespace. If you want whitespace there, put a blank before \\n. For example,

key type:long_bunch_of_stuff \\n
mount_options
key type:more_prolix\\n
_stuff mount_options

would be equivalent to

key type:long_bunch_of_stuff mount_options
key type:more_prolix_stuff mount_options

What do you think?

James F. Carter Voice 310 825 2897 FAX 310 206 6673
UCLA-Mathnet; 6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA 90095-1555
Email: [email protected] http://www.math.ucla.edu/~jimc (q.v. for PGP key)

author
#8 lore raw
In reply to Ian Kent

==> Regarding Re: [autofs] questions on auto.master file format; Ian Kent <[email protected]> adds:

[snip]

Quoted 2 lines

Reading through Sun's documentation, it seems that mount options specified in auto.master should begin with a leading dash.

[snip]

raven> Oops. My mistake.

Okay, so do you have an opinion on my initial question: Is this something we want to be compatible with?

Thanks!

Jeff