[arch-general] CD eject as non-root user

Norbert Zeh nzeh at cs.dal.ca
Thu Aug 18 13:54:10 EDT 2011


Philipp Überbacher [2011.08.18 1919 +0200]:
> Excerpts from Heiko Baums's message of 2011-08-18 19:03:19 +0200:
> > Am Thu, 18 Aug 2011 13:44:23 -0300
> > schrieb Norbert Zeh <nzeh at cs.dal.ca>:
> > 
> > > I have a strange problem with ejecting CDs from my CD drive.
> > > 
> > > As root:
> > > 
> > > eject and eject -t work flawlessly
> > > eject -T gives
> > > 
> > >     ioctl: Input/output error
> > > 
> > > As non-root user:
> > > 
> > > eject -t closes the tray as expected
> > > eject gives
> > > 
> > >     eject: unable to eject, last error: Inappropriate ioctl for device
> > > 
> > > eject -T gives the same result as for root
> > > 
> > > It doesn't matter whether I do or do not specify sr0 as the device to
> > > eject.  The non-root user that I try to execute this command as is in
> > > the optical group.
> > >
> > > ...
> > > 
> > > Does anybody else experience this type of problem?  Does anybody have
> > > any pointers what may be wrong with my setup?
> > 
> > Eject only works for root. So you have to use sudo to be able to
> > ejecting the CDs.
> > 
> > Heiko
> 
> Definitely not true, it works here without being root, but:
> $ eject
> eject: unable to find or open device for: `cdrom'
> 
> $ eject /dev/sr0
> works

This difference can be fixed by setting a symlink, but that's not relevant to
this issue here, as (after setting the symlink) the behaviour is identical with
or without specifying sr0 as the device.  Also, in the past, what made the
difference for a non-root user to be able to eject was membership in the
"optical" group.  For a user that is not in that group, permission to access
/dev/sr0 is simply denied.  A user in that group can write to /dev/sr0, but
something wonky is going on because the effect is not the same as if root
carried out the command.

> $ eject -T /dev/sr0 (while tray is ejected)
> eject: CD-ROM tray close command failed: Input/output error
> 
> $ sudo eject -T /dev/sr0
> Password: 
> eject: CD-ROM tray close command failed: Input/output error
> 
> or anything else that should pull the tray back in doesn't work on my
> machine, according to 'man eject' this may simply be a hardware
> limitation.

Indeed.  On my machine, it doesn't apply, though, because it worked before,
first for three years on Debian, then for over a year under Arch.  (Actually,
it applies on the laptop but not on the desktop.)

Cheers,
Norbert


More information about the arch-general mailing list