Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 409563 - sys-fs/udev-182 no longer creates /dev/dvd symlinks and eject button doesn't work
Summary: sys-fs/udev-182 no longer creates /dev/dvd symlinks and eject button doesn't ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
: 409709 (view as bug list)
Depends on:
Blocks: 411627
  Show dependency tree
 
Reported: 2012-03-24 16:39 UTC by Denys Duchier
Modified: 2013-02-19 17:33 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denys Duchier 2012-03-24 16:39:01 UTC
I get /dev/cdrom but not /dev/dvd.  I suspect the relevant part of udev.log is this, but I don't know how to interpret it:

[7.622368] [204] udev_rules_apply_to_event: PROGRAM 'write_cd_rules' /lib/udev/rules.d/75-cd-aliases-generator.rules:7
[7.622533] [334] udev_event_spawn: starting 'write_cd_rules'
[7.810643] [204] spawn_read: 'write_cd_rules'(err) '+ RULES_FILE=/etc/udev/rules.d/70-persistent-cd.rules'
[7.810667] [204] spawn_read: 'write_cd_rules'(err) '+ . /lib/udev/rule_generator.functions'
[7.813899] [204] spawn_read: 'write_cd_rules'(err) '++ PATH=/usr/bin:/bin:/usr/sbin:/sbin'
[7.814603] [204] spawn_read: 'write_cd_rules'(err) '+ '[' -z /devices/pci0000:00/0000:00:1f.1/ata4/host3/target3:0:0/3:0:0:0/block/sr0 ']''
[7.814639] [204] spawn_read: 'write_cd_rules'(err) '+ '[' -z 1 ']''
[7.814669] [204] spawn_read: 'write_cd_rules'(err) '+ '[' '' ']''
[7.814674] [204] spawn_read: 'write_cd_rules'(err) '+ METHOD=by-path'
[7.814802] [204] spawn_read: 'write_cd_rules'(err) '+ case "$METHOD" in'
[7.814817] [204] spawn_read: 'write_cd_rules'(err) '+ '[' -z '' ']''
[7.814845] [204] spawn_read: 'write_cd_rules'(err) '+ echo '/devices/pci0000:00/0000:00:1f.1/ata4/host3/target3:0:0/3:0:0:0/block/sr0 not supported by path_id. by-id may work.''
[7.814861] [204] spawn_read: 'write_cd_rules'(err) '/devices/pci0000:00/0000:00:1f.1/ata4/host3/target3:0:0/3:0:0:0/block/sr0 not supported by path_id. by-id may work.'
[7.814870] [204] spawn_read: 'write_cd_rules'(err) '+ exit 1'
[7.815025] [204] spawn_wait: 'write_cd_rules' [334] exit with return code 1
Comment 1 Denys Duchier 2012-03-24 16:39:37 UTC
Portage 2.2.0_alpha95 (default/linux/amd64/10.0/desktop/kde, gcc-4.6.2, glibc-2.14.1-r2, 3.3.0-gentoo x86_64)
=================================================================
System uname: Linux-3.3.0-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T8100_@_2.10GHz-with-gentoo-2.1
Timestamp of tree: Fri, 23 Mar 2012 19:15:01 +0000
app-shells/bash:          4.2_p24
dev-java/java-config:     2.1.11-r3::progress
dev-lang/python:          2.7.3_pre20110925::progress, 3.2.3_pre20110925::progress
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.9.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.3
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.6-r1, 4.5.3-r2, 4.6.2
sys-devel/gcc-config:     1.5.1-r1
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.2-r1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
Repositories: gentoo progress duchier
Installed sets: 
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xorg.conf.d /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://mirror.ovh.net/gentoo-distfiles/ http://de-mirror.org/distro/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en fr"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/progress /usr/local/portage"
SYNC="rsync://rsync.fr.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 apache2 apng bazaar berkdb bluetooth branding bzip2 cairo cdda cdr cli clucene consolekit cracklib crypt cups cvs cxx darcs dbus declarative djvu doc dri dts dvd dvdr emacs emboss encode exif fam firefox flac fontconfig fortran gd gdbm gdu gif git gmp gnutls gpm gstreamer gtk iconv idn imagemagick ipv6 jadetex java jpeg jpeg2k json kde kdepim kipi kpathsea lame latex lcms ldap libnotify libxml2 lzma mad marble mercurial mmx mng modules mp3 mp4 mpeg msn mudflap multilib mysql ncurses nls nptl nptlonly nsplugin ntp odbc ogg opengl openmp pam pango pcre pdf phonon php plasma png policykit ppds pppd pygments qt3support qt4 readline ruby sdl semantic-desktop session skype slp sms spell sqlite sqlite3 sse sse2 ssl startup-notification subversion svg sysfs tcpd theora threads tiff tk toolkit-scroll-bars truetype udev unicode usb v4l v4l2 vdpau vlc vorbis webkit webpresence x264 xattr xcb xcomposite xft xine xinerama xml xorg xscreensaver xulrunner xv xvid xvmc yahoo zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en fr" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-03-24 16:54:11 UTC
Please post your `emerge -vpq sys-fs/udev' output in a comment.
Comment 3 Denys Duchier 2012-03-24 17:01:12 UTC
(In reply to comment #2)
> Please post your `emerge -vpq sys-fs/udev' output in a comment.

# emerge -vpq sys-fs/udev
[ebuild   R   ] sys-fs/udev-182  USE="doc gudev hwdb keymap openrc rule_generator -build -debug -floppy -introspection (-selinux) -static-libs"
Comment 4 Rafał Mużyło 2012-03-24 18:01:50 UTC
A part of this is not a bug, but an intended change, see http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=19b66dc57cce27175ff421c4c3a37e4a491b9c01 and http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=927f3bc4689d06f22843d2635377c3c1cfca1ba0
The other might be something not quite udev related.
Comment 5 Denys Duchier 2012-03-24 18:30:56 UTC
(In reply to comment #4)
> A part of this is not a bug, but an intended change, see
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;
> h=19b66dc57cce27175ff421c4c3a37e4a491b9c01 and
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;
> h=927f3bc4689d06f22843d2635377c3c1cfca1ba0

that really sucks.  it used to work fine.

> The other might be something not quite udev related.

this used to work fine too, and the eject command still works.  I just don't think that udev has put in place the rule for reacting to DISK_EJECT_REQUEST.
Comment 6 Rafał Mużyło 2012-03-24 21:12:53 UTC
@comment 5: it might be a conflict in your userspace; see these two commits:
http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=b20fd3cb3423676a86f12189126b012d2297d5f7
and
http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=c5a41da94916815ac14d950a0547bffc4411f7af

udisks got a fix to make use of this (quite a while ago), but perhaps something on your system needs a fix too.
Comment 7 Denys Duchier 2012-03-24 22:07:43 UTC
(In reply to comment #6)
> @comment 5: it might be a conflict in your userspace; see these two commits:
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;
> h=b20fd3cb3423676a86f12189126b012d2297d5f7
> and
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;
> h=c5a41da94916815ac14d950a0547bffc4411f7af
> 
> udisks got a fix to make use of this (quite a while ago), but perhaps
> something on your system needs a fix too.

I am running ~amd64 which I update practically daily (emerge -uD system world). and there's no eject related stuff in udev.log
Comment 8 William Hubbs gentoo-dev 2012-03-25 00:34:01 UTC
I emailed upstream and was advised that there shouldn't be an issue with
this.

I checked my system and found that /dev/dvd didn't exist here either,
and ran the following commands:

# rm /etc/udev/rules.d/70-persistent-cd.rules
# rc-service udev restart

 This brought the symbolic link back.

 So, you might try this and see if everything works afterword. Please
 let us know.
Comment 9 William Hubbs gentoo-dev 2012-03-25 21:53:50 UTC
I am closing this because the steps in comment #8 fixed the issue for
me. Please feel free to re-open if this is still an issue.
Comment 10 William Hubbs gentoo-dev 2012-03-26 00:35:44 UTC
*** Bug 409709 has been marked as a duplicate of this bug. ***
Comment 11 Sebastian Pipping gentoo-dev 2012-03-26 01:28:59 UTC
(In reply to comment #8)
> # rm /etc/udev/rules.d/70-persistent-cd.rules
> # rc-service udev restart
> 
>  This brought the symbolic link back.

Not for me, still no /dev/dvd.  What it did do is kill my keyboard settings (like delay and layout) in XFCE, that's all I can see.


(In reply to comment #9)
> I am closing this because the steps in comment #8 fixed the issue for
> me. Please feel free to re-open if this is still an issue.

Good, re-opening.
Comment 12 William Hubbs gentoo-dev 2012-03-26 03:57:04 UTC
(In reply to comment #11)
> (In reply to comment #8)
> > # rm /etc/udev/rules.d/70-persistent-cd.rules
> > # rc-service udev restart
> > 
> >  This brought the symbolic link back.
> 
> Not for me, still no /dev/dvd.  What it did do is kill my keyboard settings
> (like delay and layout) in XFCE, that's all I can see.
> 
I have emailed your info to upstream I will update the bug when I get a response.
Comment 13 Denys Duchier 2012-03-26 17:02:42 UTC
(In reply to comment #8)
> I emailed upstream and was advised that there shouldn't be an issue with
> this.
> 
> I checked my system and found that /dev/dvd didn't exist here either,
> and ran the following commands:
> 
> # rm /etc/udev/rules.d/70-persistent-cd.rules
> # rc-service udev restart
> 
>  This brought the symbolic link back.
> 
>  So, you might try this and see if everything works afterword. Please
>  let us know.

that doesn't work: I don't have 70-persistent-cd.rules (it doesn't get created at all).  so I could restart udev till I am blue in face, it won't do any good.  It's easy enough to add back a rule to create the /dev/dvd symlink; but I have no idea how to get back the eject functionality.
Comment 14 Sebastian Pipping gentoo-dev 2012-03-26 17:05:08 UTC
(In reply to comment #13)
> that doesn't work: I don't have 70-persistent-cd.rules (it doesn't get
> created at all).  so I could restart udev till I am blue in face, it won't
> do any good.  It's easy enough to add back a rule to create the /dev/dvd
> symlink; but I have no idea how to get back the eject functionality.

I should have mentioned that restarting udev didn't create 70-persistent-cd.rules for me either.  Just so you know.
Comment 15 William Hubbs gentoo-dev 2012-03-26 17:21:10 UTC
What about the /dev/cdrom link? Do both of you have that link?
Comment 16 Denys Duchier 2012-03-26 17:25:31 UTC
(In reply to comment #15)
> What about the /dev/cdrom link? Do both of you have that link?

yes, I have it.  and here is what udevadm has to say about it:

# udevadm info --query=all --name=cdrom
P: /devices/pci0000:00/0000:00:1f.1/ata4/host3/target3:0:0/3:0:0:0/block/sr0
N: sr0
L: -100
S: cdrom
S: disk/by-id/ata-MATSHITA_DVD+_-RW_UJ-857G
S: dvd
E: DEVLINKS=/dev/cdrom /dev/disk/by-id/ata-MATSHITA_DVD+_-RW_UJ-857G /dev/dvd
E: DEVNAME=/dev/sr0
E: DEVPATH=/devices/pci0000:00/0000:00:1f.1/ata4/host3/target3:0:0/3:0:0:0/block/sr0
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_BUS=ata
E: ID_CDROM=1
E: ID_CDROM_CD=1
E: ID_CDROM_CD_R=1
E: ID_CDROM_CD_RW=1
E: ID_CDROM_DVD=1
E: ID_CDROM_DVD_PLUS_R=1
E: ID_CDROM_DVD_PLUS_RW=1
E: ID_CDROM_DVD_PLUS_R_DL=1
E: ID_CDROM_DVD_R=1
E: ID_CDROM_DVD_RW=1
E: ID_CDROM_MRW=1
E: ID_CDROM_MRW_W=1
E: ID_MODEL=MATSHITA_DVD+_-RW_UJ-857G
E: ID_MODEL_ENC=MATSHITA\x20DVD+\x2f-RW\x20UJ-857G\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_REVISION=Z111
E: ID_SERIAL=MATSHITA_DVD+_-RW_UJ-857G
E: ID_TYPE=cd
E: MAJOR=11
E: MINOR=0
E: SUBSYSTEM=block
E: TAGS=:udev-acl:
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=7766207
Comment 17 Sebastian Pipping gentoo-dev 2012-03-26 18:02:36 UTC
(In reply to comment #15)
> What about the /dev/cdrom link? Do both of you have that link?

Yes:

# ls -al /dev/cdrom 
lrwxrwxrwx 1 root root 3 Mär 26 16:58 /dev/cdrom -> sr0
Comment 18 William Hubbs gentoo-dev 2012-03-26 20:32:03 UTC
(In reply to comment #17)
> (In reply to comment #15)
> > What about the /dev/cdrom link? Do both of you have that link?
> 
> Yes:
> 
> # ls -al /dev/cdrom 
> lrwxrwxrwx 1 root root 3 Mär 26 16:58 /dev/cdrom -> sr0

Can you also post the output from:

udevadm info --query=all --name=cdrom

Thanks,

William
Comment 19 Sebastian Pipping gentoo-dev 2012-03-27 02:32:15 UTC
(In reply to comment #18)
> Can you also post the output from:
> 
> udevadm info --query=all --name=cdrom

P: /devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0
N: sr0
L: -100
S: cdrom
S: disk/by-id/ata-HL-DT-ST_DVDRAM_GU10N_M22A9360306
E: DEVLINKS=/dev/cdrom /dev/disk/by-id/ata-HL-DT-ST_DVDRAM_GU10N_M22A9360306
E: DEVNAME=/dev/sr0
E: DEVPATH=/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
E: ID_BUS=ata
E: ID_CDROM=1
E: ID_CDROM_CD=1
E: ID_CDROM_CD_R=1
E: ID_CDROM_CD_RW=1
E: ID_CDROM_DVD=1
E: ID_CDROM_DVD_PLUS_R=1
E: ID_CDROM_DVD_PLUS_RW=1
E: ID_CDROM_DVD_PLUS_R_DL=1
E: ID_CDROM_DVD_R=1
E: ID_CDROM_DVD_RAM=1
E: ID_CDROM_DVD_RW=1
E: ID_CDROM_MRW=1
E: ID_CDROM_MRW_W=1
E: ID_MODEL=HL-DT-ST_DVDRAM_GU10N
E: ID_MODEL_ENC=HL-DT-ST\x20DVDRAM\x20GU10N\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_REVISION=MX05
E: ID_SERIAL=HL-DT-ST_DVDRAM_GU10N_M22A9360306
E: ID_SERIAL_SHORT=M22A9360306
E: ID_TYPE=cd
E: MAJOR=11
E: MINOR=0
E: SUBSYSTEM=block
E: TAGS=:udev-acl:
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=42448904
Comment 20 josef.95 2012-03-29 22:26:29 UTC
I think it is kernel dependent. <kernel-3.3.0 (actual 3.2.12) works here fine - udev-182-r2 generate the /etc/udev/rules.d/70-persistent-cd.rules and the Symlinks fine.

cat /etc/udev/rules.d/70-persistent-cd.rules 
# This file was automatically generated by the /lib/udev/write_cd_rules
# program, run by the cd-aliases-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and set the $GENERATED variable.

# HL-DT-ST_BDDVDRW_CH08LS10 (pci-0000:00:07.0-scsi-1:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.0-scsi-1:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.0-scsi-1:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.0-scsi-1:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.0-scsi-1:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"


ls -l /dev/ | grep -e cdr -e dvd
lrwxrwxrwx  1 root root             3 Mar 29 13:58 cdrom -> sr0
lrwxrwxrwx  1 root root             3 Mar 29 13:58 cdrw -> sr0
lrwxrwxrwx  1 root root             3 Mar 29 13:58 dvd -> sr0
lrwxrwxrwx  1 root root             3 Mar 29 13:58 dvdrw -> sr0
crw-rw----+ 1 root cdrom      21,   1 Mar 29 13:58 sg1
brw-rw----+ 1 root cdrom      11,   0 Mar 29 13:58 sr0

Only with kernel-3.3.0 missing the Symlinks
I have not Idea why exactly.

emerge -pvq udev
[ebuild   R   ] sys-fs/udev-182-r2  USE="floppy gudev hwdb keymap openrc rule_generator -build -debug -doc -introspection (-selinux) -static-libs"
Comment 21 Denys Duchier 2012-03-30 19:17:24 UTC
I have some additional clues (not meaningful to me, but perhaps to you):

before inserting a dvd into the drive, the eject button "works" in the sense that I can hear it trigger the eject mechanism in the drive.

however, after a dvd has been inserted into the drive, the eject button no longer works.

I can then eject the dvd using the eject command (which works), however the eject button still doesn't work with the now empty drive.
Comment 22 Alexandre Ferreira 2012-04-01 14:45:44 UTC
I did some debugging on this problem. This is an excerpt of udev.log with debug active. In the timestamp 26126.329465 we see that ID_PATH is not being set so write_cd_rules bails out. Changing to use by-id instead of using by-path in /lib/udev/rules.d/75-cd-aliases-generator.rules works fine. A little more investigation is needed to find why ID_PATH is not being generated.

[26126.319794] [17516] udev_rules_apply_to_event: IMPORT builtin 'path_id' /lib/udev/rules.d/60-persistent-storage.rules:57
[26126.319836] [17516] udev_rules_apply_to_event: IMPORT builtin 'path_id' returned non-zero
[26126.319857] [17516] udev_rules_apply_to_event: RUN 'udev-acl --action=$env{ACTION} --device=$env{DEVNAME}' /lib/udev/rules.d/70-udev-acl.rules:74
[26126.319868] [17516] udev_rules_apply_to_event: PROGRAM 'write_cd_rules' /lib/udev/rules.d/75-cd-aliases-generator.rules:7
[26126.328633] [17516] spawn_read: 'write_cd_rules'(err) '+ RULES_FILE=/etc/udev/rules.d/70-persistent-cd.rules'
[26126.328697] [17516] spawn_read: 'write_cd_rules'(err) '+ . /lib/udev/rule_generator.functions'
[26126.328808] [17516] spawn_read: 'write_cd_rules'(err) '++ PATH=/usr/bin:/bin:/usr/sbin:/sbin'
[26126.329465] [17516] spawn_read: 'write_cd_rules'(err) '+ '[' -z /devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 ']''
[26126.329513] [17516] spawn_read: 'write_cd_rules'(err) '+ '[' -z 1 ']''
[26126.333214] [17516] spawn_read: 'write_cd_rules'(err) '+ '[' '' ']''
[26126.333310] [17516] spawn_read: 'write_cd_rules'(err) '+ METHOD=by-path'
[26126.333442] [17516] spawn_read: 'write_cd_rules'(err) '+ case "$METHOD" in'
[26126.333476] [17516] spawn_read: 'write_cd_rules'(err) '+ '[' -z '' ']''
[26126.333511] [17516] spawn_read: 'write_cd_rules'(err) '+ echo '/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 not supported by path_id. by-id may work.''
[26126.333552] [17516] spawn_read: 'write_cd_rules'(err) '/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sr0 not supported by path_id. by-id may work.'
[26126.333573] [17516] spawn_read: 'write_cd_rules'(err) '+ exit 1'
[26126.333794] [17516] spawn_wait: 'write_cd_rules' [17659] exit with return code 1
Comment 23 William Hubbs gentoo-dev 2012-04-02 16:14:57 UTC
(In reply to comment #22)
> I did some debugging on this problem. This is an excerpt of udev.log with
> debug active. In the timestamp 26126.329465 we see that ID_PATH is not being
> set so write_cd_rules bails out. Changing to use by-id instead of using
> by-path in /lib/udev/rules.d/75-cd-aliases-generator.rules works fine. A
> little more investigation is needed to find why ID_PATH is not being
> generated.

The change you mention is actually already done in udev-182, so I don't know why you don't have the correct rules file. Can you try emerging udev-182-r2 again and make sure it merges successfully?
Comment 24 Denys Duchier 2012-04-02 19:07:57 UTC
(In reply to comment #23)
> (In reply to comment #22)
> > I did some debugging on this problem. This is an excerpt of udev.log with
> > debug active. In the timestamp 26126.329465 we see that ID_PATH is not being
> > set so write_cd_rules bails out. Changing to use by-id instead of using
> > by-path in /lib/udev/rules.d/75-cd-aliases-generator.rules works fine. A
> > little more investigation is needed to find why ID_PATH is not being
> > generated.
> 
> The change you mention is actually already done in udev-182, so I don't know
> why you don't have the correct rules file. Can you try emerging udev-182-r2
> again and make sure it merges successfully?

I updated to udev-182-r3 and that still doesn't help
Comment 25 Alexandre Ferreira 2012-04-03 02:49:44 UTC
(In reply to comment #24)
> (In reply to comment #23)
> > (In reply to comment #22)
> > > I did some debugging on this problem. This is an excerpt of udev.log with
> > > debug active. In the timestamp 26126.329465 we see that ID_PATH is not being
> > > set so write_cd_rules bails out. Changing to use by-id instead of using
> > > by-path in /lib/udev/rules.d/75-cd-aliases-generator.rules works fine. A
> > > little more investigation is needed to find why ID_PATH is not being
> > > generated.
> > 
> > The change you mention is actually already done in udev-182, so I don't know
> > why you don't have the correct rules file. Can you try emerging udev-182-r2
> > again and make sure it merges successfully?
> 
> I updated to udev-182-r3 and that still doesn't help

udev-182-r3 changed the configuration for usb/ieee1394 but not for scsi/sata interfaces.

changing line: 
ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules", SYMLINK+="%c"
to:
ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules by-id", SYMLINK+="%c"

solves this problem for me.
Comment 26 Pacho Ramos gentoo-dev 2012-09-12 07:17:02 UTC
What is the status of this with udev-189? I don't have /dev/dvd link, but eject still works fine for me :|
Comment 27 Juergen Rose 2012-09-12 10:51:10 UTC
I have with udev-189 neither /etc/udev/rules.d/70-persistent-cd.rules nor a /dev/dvd link. Is is also not created, if I restart udev (/etc/init.d/udev restart or rc-service udev restart). /dev/cdrom exist and eject works. But if I insert a DVD, it is not mounted.
Comment 28 Pacho Ramos gentoo-dev 2012-09-12 19:14:45 UTC
(In reply to comment #27)
> I have with udev-189 neither /etc/udev/rules.d/70-persistent-cd.rules nor a
> /dev/dvd link. Is is also not created, if I restart udev (/etc/init.d/udev
> restart or rc-service udev restart). /dev/cdrom exist and eject works. But
> if I insert a DVD, it is not mounted.

Do you mean you cannot even manually mount it or are you referring to automounting problem?
Comment 29 William Hubbs gentoo-dev 2012-09-13 16:33:08 UTC
I have just been informed by upstream that the creation of /dev/dvd was
part of the persistent rules generator which has been removed. If you
need the /dev/dvd link, you should write rules to create it.

In case you are wondering, /dev/cdrom still exists because it is a
fixed link which points to sr0 and is not based on any device
capabilities or any other logic, similar to /dev/rtc->rtc0.

If you are having an issue with automounting, that is not a udev issue
since udev rules should not be used to mount filesystems.
Comment 30 Sebastian Pipping gentoo-dev 2012-09-14 20:59:31 UTC
Some applications use /dev/dvd by default, VLC for instance.

If upstream's udev does not create it any more, fine.  However, Gentoo should offer automatic creation of /dev/dvd from some package and make apps like VLC depend on that package.  We could write a udev rule and make a package sys-fs/dev-dvd-node or add a use flag to the udev package controlling the installation of such rule file.  Please let's team up on something that aactually works for our users.
Comment 31 William Hubbs gentoo-dev 2012-09-14 22:00:45 UTC
The problem is there is not a way to know what /dev/dvd should point to.
If we pick something and force it to point somewhere, that will not work
for all of our users.

/dev/cdrom is safe pointing to sr0, but /dev/dvd is not.

Upstream sees this as a task that the system admin should perform by
writing rules in /etc/udev/rules.d, just like persistent naming of
network interfaces, and I tend to agree.
Comment 32 William Hubbs gentoo-dev 2012-09-14 22:14:14 UTC
I spoke with Pacho on irc, and he found this URL for the vlc issue.
Basically vlc is going to need some changes.

[1]
https://wiki.archlinux.org/index.php/DVD_Playing#Error_.22..._could_not_open_the_disc_.2Fdev.2Fdvd.22
Comment 33 Sebastian Pipping gentoo-dev 2012-09-14 22:55:33 UTC
(In reply to comment #32)
> I spoke with Pacho on irc, and he found this URL for the vlc issue.
> Basically vlc is going to need some changes.
> 
> [1]
> https://wiki.archlinux.org/index.php/DVD_Playing#Error_.22...
> _could_not_open_the_disc_.2Fdev.2Fdvd.22

Interesting.  Maybe open a dedicated bug?  I wonder if VLC is the only thing that defaults to /dev/dvd.  If so, we could add /dev/dvd wired to /dev/sr0 b default and leave eidting to the user.  Since udev rules live in /etc, that should work well.  I assume that's more convenient than leaving the whole file to create to the user.  What do you think?
Comment 34 William Hubbs gentoo-dev 2012-09-14 23:21:06 UTC
(In reply to comment #33)
> Interesting.  Maybe open a dedicated bug?  I wonder if VLC is the only thing
> that defaults to /dev/dvd.  If so, we could add /dev/dvd wired to /dev/sr0 b
> default and leave eidting to the user.  Since udev rules live in /etc, that
> should work well.  I assume that's more convenient than leaving the whole
> file to create to the user.  What do you think?

A couple of things.

Packages are not allowed to install udev rules in /etc; that is for system admins.

The other thing is that udev never actually hard-wired /dev/dvd to /dev/sr0. It tried to guess what the device was to wire the symlink to based on attributes of the device. Wiring /dev/cdrom to sr0 is safe, but assuming that sr0 is also a dvd drive might not be, so that is why upstream dropped the dvd link.
Comment 35 William Hubbs gentoo-dev 2012-09-14 23:27:41 UTC
I see the concern about packages defaulting to /dev/dvd, I'm just not
 real comfortable with hardwiring dvd->sr0. That could actually break
 things if dvd wasn't pointing to sr0 on someone's system before.
Comment 36 Juergen Rose 2013-02-19 16:56:14 UTC
I hit the issue with the missing /dev/dvd again. If I try to play a DVD with gxine, I get "Read Error from: /dev/dvd" and I see at the terminal where I started gxine:

libdvdread: Could not open /dev/dvd
libdvdnav: vm: failed to open/read the DVD
libdvdnav: Using dvdnav version 4.2.0
libdvdread: Using libdvdcss version 1.2.12 for DVD access
libdvdread: Can't stat /dev/dvd

As before I do not have a /dev/dvd device, /dev/cdrom is a link to /dev/sr0. 


root@impala:/root(110)#  grep -v ^# /etc/udev/rules.d/70-persistent-cd.rules 

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-18:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-18:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-18:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-18:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-0:0:0:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-0:0:0:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-0:0:0:0", SYMLINK+="dvd1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:14.1-scsi-0:0:0:0", SYMLINK+="dvdrw1", ENV{GENERATED}="1"
Comment 37 Juergen Rose 2013-02-19 17:01:04 UTC
If I insert a DVD into the DVD drive, I get a general protection error:

root@impala:/root(139)# tail /var/log/messages
Feb 19 17:25:54 impala smartd[26914]: Device: /dev/sdc [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 154 to 157
Feb 19 17:25:54 impala smartd[26914]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 154 to 157
Feb 19 17:30:01 impala cron[28784]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)
Feb 19 17:40:01 impala cron[28865]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)
Feb 19 17:50:01 impala cron[28918]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)
Feb 19 17:51:11 impala cdrom_id: custom logging function 0x402140 registered
Feb 19 17:51:11 impala ata_id: custom logging function 0x4024c0 registered
Feb 19 17:51:15 impala kernel: [179454.720684] traps: osinfo-detect[28940] general protection ip:7f539482c7fc sp:7fff63f242c0 error:0 in libgobject-2.0.so.0.3400.3[7f53947f9000+50000]
Comment 38 William Hubbs gentoo-dev 2013-02-19 17:33:51 UTC
(In reply to comment #36)
> I hit the issue with the missing /dev/dvd again. If I try to play a DVD with
> gxine, I get "Read Error from: /dev/dvd" and I see at the terminal where I
> started gxine:
> 
> libdvdread: Could not open /dev/dvd
> libdvdnav: vm: failed to open/read the DVD
> libdvdnav: Using dvdnav version 4.2.0
> libdvdread: Using libdvdcss version 1.2.12 for DVD access
> libdvdread: Can't stat /dev/dvd
> 
> As before I do not have a /dev/dvd device, /dev/cdrom is a link to /dev/sr0. 

The easiest fix for this would be to configure gxine to use the correct device and not try to use the /dev/dvd symlink.

Also, make sure you are using latest stable udev which is udev-197-r8.