LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-17-2013, 10:08 AM   #16
GazL
Senior Member
 
Registered: May 2008
Posts: 3,440

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959

/lib/udev/rules.d/60-cdrom_id.rules seems to be complicit in this.
Code:
# media eject button pressed
ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdrom_end"

# import device and media properties and lock tray to
# enable the receiving of media eject button events
IMPORT{program}="cdrom_id --lock-media $devnode"
I assume that the locking mechanism is to ensure that udev is involved in any media changes that occur so that it can keep track of things.


I use autofs to mount my cdrom on /misc/cd so I have no use for the udev based volume management. Commenting out both of the above returns things to the old-school way of working, but will obviously have implications for anything that relies on udev for the optical volume management.
 
Old 04-17-2013, 10:43 AM   #17
GazL
Senior Member
 
Registered: May 2008
Posts: 3,440

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959
BTW, just removing the '--lock-media' appears to allow an unpatched eject to work normally. You'll need to see whether it causes problems for your desktop environment though.
A quick test with Thunar seems to show no ill effects, though there could be some weird edge-cases I haven't encountered in a quick test.

update:

Actually I just found one. if you press the physical eject button while the cd is mounted in thunar then it ejects but leaves it mounted.
Also commenting out the eject rule helps prevent the above, but causes problems of its own. So it seems that the locking is needed for correct operation with the way this code is currently implemented.

So, looks like you either need to leave it as it is, or take out both rules for reliable operation.

Last edited by GazL; 04-17-2013 at 11:04 AM.
 
Old 04-17-2013, 11:12 AM   #18
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Interesting. The udev rule before Slackware 14.0 is not like that. I wonder when the lock criterion was added to the rule? And why? (Are the systemd folks responsible?: http://lists.freedesktop.org/archive...il/001830.html)

Anybody wanting to not use the patch could create their own rule to override the stock rule. Copy the existing rule to /etc/udev/rules.d and change the name to 99-cdrom_id.rules. Then remove the lock criterion.

Looks like the new rule has other effects too.

Last edited by Woodsman; 04-17-2013 at 11:24 AM.
 
Old 04-17-2013, 12:39 PM   #19
GazL
Senior Member
 
Registered: May 2008
Posts: 3,440

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959
Hmm, this whole area is a complete mess. It wouldn't be so bad if udisks had had the sense to realise that people might actually want to eject an empty drive.
Seems to me there are 2 choices,

Comment out both of those rules and use the old school commands,
Leave them in place and use the new-fangled udisks stuff and live with its failings.

Patching eject with this patch has the potential to cause side-effects for the new-fangled stuff.
 
Old 04-17-2013, 01:18 PM   #20
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Quote:
Hmm, this whole area is a complete mess.
Not surprising, considering who now controls udev and udisks.

Quote:
It wouldn't be so bad if udisks had had the sense to realise that people might actually want to eject an empty drive.
Well, um, yeah, kind of obvious to me too. Not to mention those people who want to prevent accidental bumping of the external switch. Oh but wait, who uses optical disks anymore? That is so, like, 1990s.

Quote:
Comment out both of those rules and use the old school commands,
Leave them in place and use the new-fangled udisks stuff and live with its failings.
I'll have to tinker with this. Adding an overriding rule in /etc/udev/rules.d is easy enough, possibly even just grab the old rule from pre 14.0.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to eject a removable device in a software way, but not by "eject"command viktor2000 Linux - Newbie 13 10-14-2011 04:40 AM
Command not working in cron job, but works fine in root Roosta21 Linux - Software 4 11-22-2007 08:08 AM
uptime command only works for root user thoron! *BSD 6 09-08-2007 04:23 PM
Can't eject iPod as normal user, but works as root FreeThinkerJim Linux - Hardware 3 11-18-2005 08:19 PM
CD Won't Eject With "eject" Command Dr. Ephemeron Slackware 13 11-13-2003 12:27 AM


All times are GMT -5. The time now is 03:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration