Bug 134564

Summary: Logging out a user (not root) should trigger a umount of all the volumes he/she mounted
Product: [Fedora] Fedora Reporter: Kyrre Ness Sjøbæk <kyrsjo>
Component: gnome-volume-managerAssignee: John (J5) Palmieri <johnp>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: jkeck
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-07 21:26:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kyrre Ness Sjøbæk 2004-10-04 17:34:53 UTC
<copy-paste from fedora-devel-list>

While there are so much chattering about automounting, security
considerations of the new fstab "console" tag etc., i have as a systems
administrator withnessed one thing - with something as old as floppyes.

People mount up the floppy (acctually, they have no clue that they are
mounting it, they just click the nice little "floppy" icon), get their
files, pull out the floppy (without umounting), and logs out.

Then, 2 minutes later, another user logs in, pulls up his/her floppy,
and... the floppy is mounted. Cant get it umounted, and can't mount
his/her floppy. Grr...

Reason that there is a problem with floppyes and not other removable
storage, is of cource that floppyes is the only removable storage that
the user can pull out without the system gets the message - if you pull
an usb mass storage plug, it gets umounted (and it is mounted "sync" so
you probably won't loose data either). If you try to eject a cd, it wont
come out - untill you umount it (this is really frustrating to new users
as well - the "eject" button should umount the cd and eject it, and if
it is buisy, tell dbus to tell gnome to display that popup we all loved
in fc1)

But what if all volumes that the user mounted when he/she was logged on,
automatically got umounted when the user who mounted it logs out? That
would solve it.

</copy-paste from fedora-devel-list>

Yes, i'm lazy. Dont shoot me. Alan told me to post an RFE to bugzilla,
and it somehow landed on basesystem. Feel free to move it :)

Comment 1 John (J5) Palmieri 2004-10-04 18:25:35 UTC
Sounds ok.  We would have to special case root so if you were logged
into an X session as root (rare but some people do it) it doesn't
unmount.  Pictures dance in my head of g-v-m bringing down '/' ;-)

Comment 2 Kyrre Ness Sjøbæk 2004-10-05 14:54:03 UTC
if (uidnumber > 0) {
 system ("umount -a");
}

Something like that in the shutdown code should umount every
not-in-use volumes the user has permissions to umount. But i see two
problems with this approach:

- What if something bad happens to gnome-volume-manager
- What if the user hits control-alt-backspace (same as #1?)
- What if the user already has "pulled" the floppy, or some stupid app
is running on it? (*KILL* it! Or simply just do a lazy umount, and
wait for the app to die of its own (the users) stupidity?)

Comment 3 John (J5) Palmieri 2004-10-05 15:11:50 UTC
The way it will work is a bit more complicated.  Can't say if it will
get into the release or not since this was requested so late but I'll
see what I can do.  Basicly short term what will happen is we will
itterate over the list of mounts lazy unmounting all mounts with
user=<the session user>.

Comment 4 John (J5) Palmieri 2004-10-07 21:26:56 UTC
Well, I guess it is your lucky day as I have just tested this and it
already works out of the box in Rawhide.

Comment 5 Kyrre Ness Sjøbæk 2004-10-08 08:41:52 UTC
:) Thats nice!

=> it will work like that in fc3 :)

How does it work?

Comment 6 John (J5) Palmieri 2004-10-08 13:47:38 UTC
Rawhide is the development version which will become FC3. 
gnome-volume-manager handles unmounting user mounts when the session
gets logged out.  I tried this with a USB memory drive and a floppy.

Comment 7 Kyrre Ness Sjøbæk 2004-10-09 11:48:26 UTC
Yes i know that. But will it work if the user hits
"control-alt-backspace" to log out as well?