[Samba] samba and automount

Christopher Odenbach odenbach at hni.uni-paderborn.de
Mon Nov 18 08:05:01 GMT 2002


Hi,

> > 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.

Samba creates a child process for each connection. So if you kill the 
process that uses the cdrom you should be alright as that is only the 
forked child for this share. All other connections should be fine.

Using something like "fuser -mk /cdrom" should do the trick.

And as someone on the list mentioned: if you tend to make the script 
suid root, better use perl instead of shell script... :-)

Christopher



More information about the samba mailing list