Bug 71272

Summary: Can't eject CD-ROM from the icon's RMB menu
Product: [Unmaintained] kio Reporter: James Richard Tyrer <tyrerj>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description James Richard Tyrer 2003-12-26 22:15:23 UTC
Version:           3.1.94 (using KDE KDE 3.1.94)
Installed from:    Compiled From Sources

Right click the CD-ROM icon on the DeskTop: Actions => Unmount.

Right click the CD-ROM icon on the DeskTop: Actions => Eject

Message: "Eject /dev/cdrom Failed"
Message: Can't find the program "kdeeject %v"

Wait a short time, and try: Actions => Eject again and it works sometimes.

--
JRT
Comment 1 James Richard Tyrer 2003-12-26 22:17:29 UTC
If this isn't the proper Product, please change.

This is what is reported on the headder of the second message window.

--
JRT
Comment 2 James Richard Tyrer 2003-12-26 22:18:29 UTC
... 

--
JRT
Comment 3 Giuseppe Torelli 2004-06-10 13:51:48 UTC
I conferm. Using KDE 3.2.1 slackware unofficial packages. When the cd/dvd is busy a first error message appears correctly saying it is not possible to eject cd. You click Ok and then a second message appears saying that KDE cannot find the kdeeject program even though it exists and it is in the path.
Comment 4 Dario Nicodemi 2004-07-25 13:40:20 UTC
I have trouble ejecting CD-ROMs under KDE 3.2.3, too.

Architecture: x86
OS: Slackware Linux 10.0
    kernel: 2.4.26
    glibc: 2.3.2
    X: x.org 6.7.0
    QT: 3.3.2
    KDE: 3.2.3 (Official Slackware packages)

I have an IDE CD recorder and an IDE CD reader.  Both are used
in SCSI emulation mode (devices /dev/sr0 and /dev/sr1).
In order to burn CDs with K3B as a regular user, I had to set file permissions as follows:

lrwxrwxrwx  1 root root        8 Jul 24 15:52 /dev/cdrom -> /dev/sr0
lrwxrwxrwx  1 root root        8 Jul 24 15:52 /dev/cdrom1 -> /dev/sr1
crw-rw----  1 root burning 21, 0 Apr 13  1999 /dev/sg0
crw-rw----  1 root burning 21, 1 Apr 13  1999 /dev/sg1
brw-rw----  1 root cdrom   11, 0 Apr 13  1999 /dev/sr0
brw-rw----  1 root cdrom   11, 1 Apr 13  1999 /dev/sr1

Assume you are a member of group 'burning' (thus, you have rw access to
/dev/sg0 and /dev/sg1).
  
someone@algol:~$ id
uid=1006(someone) gid=100(users) groups=100(users),19(cdrom),102(burning)

You insert a CD in /dev/sr0, you mount it (using desktop icons), then unmount it.  When you try to eject the media using th context menu, you get a couple of error messages:

Eject /dev/cdrom failed!
Couldn't find the program 'kdeeject %v'

You cannot eject it from command line, either:

someone@algol:~$ eject -v
eject: using default device `cdrom'
eject: device name is `cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: `/dev/sr0' is not a multipartition device
eject: trying to eject `/dev/sr0' using CD-ROM eject command
eject: CD-ROM eject command failed
eject: trying to eject `/dev/sr0' using SCSI commands
eject: SCSI eject failed
eject: trying to eject `/dev/sr0' using floppy eject command
eject: floppy eject command failed
eject: trying to eject `/dev/sr0' using tape offline command
eject: tape offline command failed
eject: unable to eject, last error: Invalid argument

Apparently, device /dev/sr0 is busy (even if it is unmounted!):

someone@algol:~$ strace eject
[...]
open("/dev/sr0", O_RDONLY|O_NONBLOCK)   = 3
ioctl(3, CDROMEJECT, 0xbffff560)        = -1 EBUSY (Device or resource busy)
ioctl(3, FIBMAP, 0xbffff410)            = -1 EACCES (Permission denied)
ioctl(3, FDEJECT, 0xbffff560)           = -1 EINVAL (Invalid argument)
[...]

In facts:

root@algol:/home/someone# lsof | grep "/dev/sg"
kdeinit   1048 someone   13u   CHR       21,0           259424 /dev/sg0
kdeinit   1048 someone   15u   CHR       21,0           259424 /dev/sg0
root@algol:/home/someone# lsof | grep "/dev/sr"
kdeinit   1048 someone   12r   BLK       11,0           259460 /dev/sr0
kdeinit   1048 someone   14r   BLK       11,0           259460 /dev/sr0
root@algol:/home/someone# ps aux|grep 1048
someone   1048  0.0  4.8 26264 12496 ?       S    18:34   0:00 kdeinit: kio_audiocd audiocd /tmp/ksocket-someone/klauncherblmL5b.slave-socket /tmp/ksocket-someone/konquerornCr5ia.slave-socket

So perhaps the bug is in audiocd KIO slave.

The eject button on the drive itself won't work.  The only way to
unlock the drive is to eject as root, or logout from KDE.  Or, wait for
a couple of minutes...

Drive /dev/sr1 works perfectly.  If the user doesn't have r/w access
to /dev/sg0, everything is ok, too.  No problems with console login and
Gnome, even if /dev/sg0 is readable/writeable.  

Yours,
     Dario Nicodemi
Comment 5 James Richard Tyrer 2004-08-17 02:14:56 UTC
This bug appears to have been fixed.

HOWEVER, problems using the Navigation Panel persist.

See BUG# 87326

--
JRT