On Thursday 10 January 2002 09:07 am, Paul Lussier wrote:
> In a message dated: Thu, 10 Jan 2002 12:25:16 GMT
>
> [EMAIL PROTECTED] said:
> >Hi,
> >
> >I'm having a problem with automount in that when I cd into the automount
> >"projects"  the sub directories are hidden.
> >If I cd into a sub directory that I know exists "/projects/network" then
> > it will appear in a ls -l of projects.
>
> This is not a "problem" but normal behavior of automount.  /projects
> is a mount point.  Until something is mounted, it does not exist on a
> client machine, and therefore, you can't see it with ls.  When you
> 'cd' into it, the OS intercepts your command, passes it off to
> automount, which then locates the appropriate file system in the
> auto.* maps, and NFS mounts the file system for you in the /projects
> directory by doing the equivalent of:
>
>       mkdir /projects/network
>       mount -t nfs server:/network /projects/network
>
> When the "automount" time out is incurred, it cleans up after itself
> by doing the equivalent of:
>
>       umount /projects/network
>       rmdir /projects/network
>
> If you need to know what's "available" under the /projects directory,
> you need to know which auto. map this information is kept in.
>
> If you're running NIS, then use the ypmatch/ypcat commands on the
> auto. maps.  If you use local files, then grep through the /etc/auto.*
> maps.
>
> HTH,

Paul-

Are there any docs available to explain how the OS intercepts this, and 
moreover, how does it inform autofs that some file under /mnt/autofloppy  has 
been requested?  It seems like if the kernel can tell autofs that 
/mnt/autofloppy is needed, all autofs needs to be is small program that 
basically does this:

if not already mounted then
  mount /mnt/autofloppy
else
  restart umount counter

(umount counter event handler)
umount /mnt/autofloppy 
restart counter if failed

Assuming that /mnt/autofloppy has an entry in fstab.  I've often wondered why 
autofs has so much code when mount & umount already do all of this, and it 
seems like autofs should be just a thin wrapper to call them.  I'm sure there 
is a good technical reason for the extra code and extra complexity.  I still 
have to rely on a rote script in order to successfully set up a simple floppy 
or cdrom automount that is visible from a GUI.  As a matter of fact, the last 
time was so painful that I swore that I would join this list just to see if I 
could learn enough about the concept to write a simple automounter that just 
used the fstab entries and mounted plain mount points, so hopefully distros 
will begin shipping with automounted drives by default.  By relying on 
mount/fstab, the auto.conf would look like this:

/mnt/cdrom 10
/mnt/floppy 2

Or even add them as mount options in fstab and remove the config file 
altogether:
/dev/cdrom    /mnt/cdrom  iso9660 noauto,ro,automount=10    0 0

Of course, I'm sure autofs would be more appropriate in more advanced cases; 
I'm just referring to local removable drives here.

What would it take to do this?  In addition to the autofs source, do you know 
of any other resources that I can refer to?

TIA,

-Todd


Reply via email to