Bug 133457 - kio_media_mounthelper -s fails when using HAL backend
Summary: kio_media_mounthelper -s fails when using HAL backend
Status: RESOLVED WORKSFORME
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: media (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-02 21:15 UTC by Valentine Sinitsyn
Modified: 2006-11-14 12:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valentine Sinitsyn 2006-09-02 21:15:41 UTC
Version:            (using KDE KDE 3.5.4)
OS:                Linux

kio_media_mounthelper -s (unmount and eject) does nothing, at least when using HAL backend for mediamanager. After executing it, the media remains mounted and no error is reported. kio_media_mounthelper -u works just fine. Since "Safely remove" desktop action relies on this command, it also does nothing.

Reproducable: always

Steps to reproduce:
1. Mount some removable media
2. Select "Safely remove" from KDE context menu

Expected results:
Media become unmounted and the icon changes

Actual result:
Nothing happens
Comment 1 Carsten Lohrke 2006-09-03 14:49:51 UTC
Dupe of bug 132523 i suppose!?
Comment 2 Valentine Sinitsyn 2006-09-03 14:58:33 UTC
> Dupe of bug 132523 i suppose!? 

I don't think so. kio_media_mounthelper -s media:/sda1 hardly has something to do with symlinks.
Comment 3 Valentine Sinitsyn 2006-09-03 15:23:03 UTC
Well, looking at the latest SVN code of kio_media_mounthelper, I guess the bug is obvious - try that link:

http://websvn.kde.org/branches/KDE/3.5/kdebase/kioslave/media/mounthelper/kio_media_mounthelper.cpp?rev=551890&r1=550578&r2=551890

Unmount code was removed from "Safely remove" (-s switch) so, for now, mounthelper just calls kdeeject -q. Given this flag, kdeeject shows no error dialog if something goes wrong. And things will actually go wrong since we are trying to eject mounted media which is bad thing, at least, in Linux.
Comment 4 Sune Vuorela 2006-10-18 12:04:19 UTC
I have tried reverting the patch locally and now umount of usb-devices works flawlessly.

Alternatively, I tried instnalling the eject-command. that also solved the problem.

/Sune
Comment 5 David Hubner 2006-11-07 04:33:06 UTC
I also have this, i have reverted to a younger kio_media_mounthelper. My guess is that kdeeject called eject which checks fstab to check if the device is mounted ( and therefore unmounts it). Hal does not show mounted devices in fstab so the eject fails. Maybe patch kdeeject to use -p option with eject so it checks /proc/mounts instead of fstab?
Comment 6 David Hubner 2006-11-07 04:53:02 UTC
Looking into it a bit more, it seems thats its a permissions problem. When eject is called and the device is not listed in fstab, eject bails if not root. -p will not help. Best bet is to umount via mediamanager then call eject.
Comment 7 Valentine Sinitsyn 2006-11-14 12:06:56 UTC
Fixed in the latest KDE SVN