Re: samba: cannot auto umount CD-ROM
Am Dienstag, 17. Dezember 2002 06:28 schrieb Dai Yuwen:
> I want to samba auto mount/umount CD-ROM. This is my `cdrom' section of
> smb.conf:
[...]
> Auto mount is OK. Every time a Windows user clicks the `cdrom' directory,
> `/cdrom' will be mounted. But it seems that `postexec' is not executed
> after the user had closed the whole connection to the samba server? To
> eject the cd-rom, I have to kill the samba process that uses /cdrom. Very
> inconvenient. Any solutions?
postexec is probably executed correctly, but Windows holds up the connection
for performance reasons (really :-) ) When you reopen a share within a
certain time (I think it's about 5 min) there is no need to reconnect (but
what about resources ... :->). I had the same problem with a ZIP drive, but I
didn't worry about it at that time.
Try eject /cdrom and wait for some time after "closing" the connection. If the
CDROM ejects, there is no problem with the command.
You might grep the output of lsof for /cdrom, extract the PID with awk and
kill that process. You can create a new share with preexec that script (or a
Webserver with CGI support)
Regards,
Tobias
--
/"\ ASCII Ribbon Campaign
\ / No proprietary formats in attachments without request
X i.e. *NO* WORD, POWERPOINT or EXCEL documents
/ \ Respect Open Standards
http://www.fsf.org/philosophy/no-word-attachments.html
http://www.goldmark.org/netrants/no-word/attach.html
Registered Linux User #293344
Reply to: