[Samba] samba and automount

Christopher Barry cbarry at infiniconsys.com
Sat Nov 16 18:32:00 GMT 2002


On Sat, 2002-11-16 at 13:08, Trey Nolen wrote:
> >
> > > I'm running Samba with automount to automatically mount CDs in a
> > > server. These CDs need to be changed periodically, so I wanted to use
> > > automount so that they could be changed by the users fairly easily.
> > > We use logon scripts to map the CDs to drive letters when users
> > > logon.  Unfortunately, it seems that having a drive mapped is treated
> > > like the drive is being used, so as long as there is someone logged
> > > into the system, automount will not unmount the drive.  The only way
> > > we can change the CDs is to have everyone log out, wait for the
> > > timeout (or unmount it manually), change the CDs and have everyone
> > > log back in.  Does anyone have a better way (one that will work)?
> >
> > Don't use the automounter. Instead write a small shell (or perl) skript
> > that mounts and unmounts the cds (and kills everything that would
> > prevent you from unmounting). When it works, make it suid root.
> 
> 
> The problem with that is that it is Samba that keeps me from unmounting.
> See, while the drives are mapped, Samba is keeping the mounts busy.  I can't
> write a script that goes around killing Samba. That would be bad.
> 
> Trey Nolen
> 
> 
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba

You have 2 options as I see it:
1. EASY: don't map the share!
2. HARDER: Compile samba --with-msdfs, drive-map the *root* of the msdfs
tree, and make the cd-rom share a 'hidden share' folder under the root.
The name of the msdfs symlink will appear as the share name to your
users. That way, even though the drive is mapped to the root,
pre/post-exec will still work when someone actually clicks on the folder
under the root.

Read up on msdfs use in samba. It's not easy at first, but once you
learn it, you'll wonder how you ever got along without it.

Good Luck,
Christopher





More information about the samba mailing list