Re: [Utopia] [patch] mount/unmount when starting/stopping



On Tue, 2004-08-17 at 13:34, David Zeuthen wrote:
> On Tue, 2004-08-17 at 13:27 -0400, Sean Middleditch wrote:
> > OK.  So assuming my hardware wasn't designed by idiots, and I'd really
> > like to be able to just hit Eject and have everything work, is it
> > currently possible without heavily patching HAL, GVM, etc?
> > 
> 
> 'echo 0 > /proc/sys/dev/cdrom/lock' would do the trick. If the disc is
> mounted and forcibly removed, then the hal daemon will issue an 'umount
> -l /dev/cdrom' (lazy unmount) and stuff works. Of course this may crash
> badly written apps (fd's from files on the mount point will be invalid)
> but anyone can write a broken app.

Other than broken apps, are there any other advantages/disadvantages
compared to having hardware that supports the eject signal stuff?  I
would personally imagine it being a tad safer to keep the drive locked,
and if the user requests an ejection, have the system be able to do
smart things like warn the user that "FooApp is currently accessing the
device" and let the user cleanly exit the program, or just click on an
Eject button to eject things anyway (and signal the app that this is
happening, so it can possible react and do cleanup if it wants), and so
on.  For example, the app might make a local on-disk cache of the file,
or just read it all into memory, or just close the document window, or
whatever.  If the drive just stays unlocked, there won't ever be able to
be this warning window with a confirmation.

> 
> The implications on the kernel side for doing this, I dunno, you may
> want to ask Robert or your local kernel guru.
> 
> However, it works very nicely for me.
> 
> > Besides, given the device info files, couldn't HAL just support the
> > Eject event, but have it turned off by default, and then let known
> > devices that support it enable it?
> > 
> 
> This could be done, yes.
> 
> > Is there a utility anywhere to test if a drive supports sending the
> > event?
> > 
> 
> No idea, sorry.
> 
> > > 
> > > Apple drives, I dunno, but I note that the eject button on my Powerbook
> > > is actually part of the keyboard. That's pretty clever.
> > 
> > So how would that work in the current framework, then?  Would the keymap
> > just call 'eject' ?  Are all the appropriate apps (Nautilus, GVM, etc.)
> > ready for this, or are they expecting HAL to handle it?
> > 
> 
> Presumably g-v-m or acme could do this. An interesting question is what
> happens if you have several drives.

Hmm.  Well, the common sense is certainly only a single drive, which
should of course Just Work(tm).  For multiple drives, in which only one
has media, it probably makes sense to just eject that one.  In the other
case, it should probably be policy that can be specified according to
the user's needs.  For example, I might set things up so the eject
button only bothers with the CD-ROM drive, and not my DVD-RW drive.  If
no such settings are made, a dialog could ask the user: display a list
of the drives, the name/ID of the media in each, etc.

> 
> Cheers,
> David
-- 
Sean Middleditch <elanthis awesomeplay com>
AwesomePlay Productions, Inc.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]