You are not logged in.

#1 2018-03-30 03:55:48

Endless Love
Member
Registered: 2017-08-31
Posts: 15

CD/DVD Tray open automatically

I've got a new laptop recently (Thinkpad T420) and just installed archlinux for 3 days (dual boot with windows 7).

My CD/DVD Tray has automatically opened since the 2nd day I used archlinux, and whenever I try to close it, it'll re-opens immediately. But when I boot to windows 7, it works normally.

I use i3-gaps as my windows manager.

I hope someone can help me with this weird behavior.
Thank you!.

Offline

#2 2018-03-30 06:58:28

seth
Member
Registered: 2012-09-03
Posts: 58,521

Re: CD/DVD Tray open automatically

Does it open during the boot process or only after login?
I'd say some rogue script calling /usr/bin/eject in a loop?

Offline

#3 2018-03-30 09:38:59

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

seth wrote:

Does it open during the boot process or only after login?

It only open after login at random time (immediately after login or hours after that)

seth wrote:

I'd say some rogue script calling /usr/bin/eject in a loop?

I've just installed arch for a few days so I don't think I have any scripts like that.

Offline

#4 2018-03-30 11:31:31

seth
Member
Registered: 2012-09-03
Posts: 58,521

Re: CD/DVD Tray open automatically

And how did you install arch?
Also you started another thread last september, so how can have "just installed arch for a few days"?

What processes actually do run?
What if you replace /usr/bin/eject w/ a script that logs its invocation?

Offline

#5 2018-03-30 12:19:50

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

seth wrote:

And how did you install arch?

I installed arch by following this guide.

seth wrote:

Also you started another thread last september, so how can have "just installed arch for a few days"?

I was using my HP Compaq laptop when I started that thread, you can confirm it in the output of dmesg in that thread.

seth wrote:

What processes actually do run?

It doesn't happen right now so I can't tell.

seth wrote:

What if you replace /usr/bin/eject w/ a script that logs its invocation?

I've just rename /usr/bin/eject to /usr/bin/oldeject and replace with this script:

#!/usr/bin/bash
echo "eject `ps -o arg= $PPID`" >> /home/endlesslove/cdtray.log

oldeject

When it happens again, I will check the log file and reply.

P/s: I ran the eject command before replacing it with the script and my cd tray opened, and I no longer can eject it even when pressing the eject button of the cd tray lol

Last edited by Endless Love (2018-03-30 12:32:38)

Offline

#6 2018-03-31 11:52:08

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

So the cd tray just got opened now but this time it didn't re-open when I close it.
No log file was created. Any guesses about what the problem is?

Offline

#7 2018-03-31 11:56:01

seth
Member
Registered: 2012-09-03
Posts: 58,521

Re: CD/DVD Tray open automatically

The drives tend to eject (in hardware) if there's a bad/unreadable/undetectable disc in them - but if they're empty, even "sudo mount /dev/sr0 /mnt" should just report there's no disc.

Offline

#8 2018-03-31 12:39:30

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

seth wrote:

The drives tend to eject (in hardware) if there's a bad/unreadable/undetectable disc in them - but if they're empty, even "sudo mount /dev/sr0 /mnt" should just report there's no disc.

There is no discs in the drive.

and

sudo mount /dev/sr0 /mnt

output

mount: /mnt: no medium found on /dev/sr0

Offline

#9 2018-03-31 13:21:44

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: CD/DVD Tray open automatically

Might you be pressing the eject button without noticing? As in when moving the mouse around and hitting the eject button without noticing.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#10 2018-03-31 15:29:23

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

R00KIE wrote:

Might you be pressing the eject button without noticing?

I read somewhere in the forum about this, so I did notice if I was pressing the eject button when I tried to close the tray.

R00KIE wrote:

As in when moving the mouse around and hitting the eject button without noticing.

I only use the mouse when browsing, but the cd tray started to open when I was coding or just after logging in, too.

Today, I notice that, when I've resumed from suspending for about one minute, the cd tray is automatically opened.

Offline

#11 2018-03-31 16:04:43

seth
Member
Registered: 2012-09-03
Posts: 58,521

Re: CD/DVD Tray open automatically

Well something™ will call the drive to eject, what brings us back to the question: what processes do actually run (notably when this happens)?

Offline

#12 2018-03-31 16:16:58

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: CD/DVD Tray open automatically

I only asked because it happens to one of my friends, it drives him mad big_smile

Something must be ejecting the cd tray, probably something you have running that issues the eject command directly.

What's the output of 'grep . /proc/sys/dev/cdrom/*'?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#13 2018-04-01 03:50:50

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

seth wrote:

Well something™ will call the drive to eject, what brings us back to the question: what processes do actually run (notably when this happens)?

Here is the proc list when it happened (removed firefox's content processes): https://pastebin.com/S0Du5pan


R00KIE wrote:

What's the output of 'grep . /proc/sys/dev/cdrom/*'?

Here is it:

/proc/sys/dev/cdrom/autoeject:0
/proc/sys/dev/cdrom/check_media:0
/proc/sys/dev/cdrom/debug:0
/proc/sys/dev/cdrom/info:CD-ROM information, Id: cdrom.c 3.20 2003/12/17
/proc/sys/dev/cdrom/info:drive name:		sr0
/proc/sys/dev/cdrom/info:drive speed:		24
/proc/sys/dev/cdrom/info:drive # of slots:	1
/proc/sys/dev/cdrom/info:Can close tray:		1
/proc/sys/dev/cdrom/info:Can open tray:		1
/proc/sys/dev/cdrom/info:Can lock tray:		1
/proc/sys/dev/cdrom/info:Can change speed:	1
/proc/sys/dev/cdrom/info:Can select disk:	0
/proc/sys/dev/cdrom/info:Can read multisession:	1
/proc/sys/dev/cdrom/info:Can read MCN:		1
/proc/sys/dev/cdrom/info:Reports media changed:	1
/proc/sys/dev/cdrom/info:Can play audio:		1
/proc/sys/dev/cdrom/info:Can write CD-R:		1
/proc/sys/dev/cdrom/info:Can write CD-RW:	1
/proc/sys/dev/cdrom/info:Can read DVD:		1
/proc/sys/dev/cdrom/info:Can write DVD-R:	1
/proc/sys/dev/cdrom/info:Can write DVD-RAM:	1
/proc/sys/dev/cdrom/info:Can read MRW:		1
/proc/sys/dev/cdrom/info:Can write MRW:		1
/proc/sys/dev/cdrom/info:Can write RAM:		1
/proc/sys/dev/cdrom/lock:1

--
Also, I found something in the output of "journalctl -b 0" at line 1206 and 1410: https://pastebin.com/cPV6Wd0t

Last edited by Endless Love (2018-04-01 03:51:18)

Offline

#14 2018-04-01 07:37:21

seth
Member
Registered: 2012-09-03
Posts: 58,521

Re: CD/DVD Tray open automatically

root       241  0.0  0.1  88192  8552 ?        Ss   09:15   0:00 /usr/lib/systemd/systemd-udevd
...
root      4162  0.0  0.0  88192  5316 ?        S    10:15   0:00 /usr/lib/systemd/systemd-udevd
root      4164  0.0  0.0  70468  3260 ?        D    10:15   0:00 /usr/lib/udev/cdrom_id --eject-media /dev/sr0

So there's a second systemd-udevd process and a (of course systemD'ohhh needs a custom eject tool) related eject call waiting for I/O response.... looks kinda shady to me ;-)

Why is there a second udevd process? It seems started 1h after the original one. Do they increment?

Offline

#15 2018-04-01 13:33:26

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

seth wrote:
root       241  0.0  0.1  88192  8552 ?        Ss   09:15   0:00 /usr/lib/systemd/systemd-udevd
...
root      4162  0.0  0.0  88192  5316 ?        S    10:15   0:00 /usr/lib/systemd/systemd-udevd
root      4164  0.0  0.0  70468  3260 ?        D    10:15   0:00 /usr/lib/udev/cdrom_id --eject-media /dev/sr0

So there's a second systemd-udevd process and a (of course systemD'ohhh needs a custom eject tool) related eject call waiting for I/O response.... looks kinda shady to me ;-)

Why is there a second udevd process? It seems started 1h after the original one. Do they increment?

I don't know.
So udev run the command for "eject button press event" even when the eject button wasn't pressed?

The cd tray just opened right now, but when I re-checked the process list, I didn't see the command to eject the cd drive anymore, but the command to lock:

/usr/lib/udev/cdrom_id --lock-media /dev/sr0

Hmm, I'm thinking about whether I should completely disable the cd/dvd drive...

Last edited by Endless Love (2018-04-01 13:41:32)

Offline

#16 2018-04-01 13:45:11

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: CD/DVD Tray open automatically

What if you replace cdrom_id by a script, like you did to eject, to check what is calling it? If it was me I would rather get to the bottom of this than disable the hardware.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#17 2018-04-01 18:24:38

seth
Member
Registered: 2012-09-03
Posts: 58,521

Re: CD/DVD Tray open automatically

There should not be two udevd processes running, so i'd focus on where the additional one's coming from.
The timing is suspicious, so would certainly be even more udev daemons (if they run along the tray interaction)

You should also try the behavior for a different user login and w/o i3bar (random blame since i believe it runs all sorts of sub-scripts?) - though the daemon and eject are root owned, it might still be induced by something specific to your setup.

Offline

#18 2018-04-03 11:39:11

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

R00KIE wrote:

What if you replace cdrom_id by a script, like you did to eject, to check what is calling it? If it was me I would rather get to the bottom of this than disable the hardware.

I've replaced the cdrom_id  like you said:

#!/usr/bin/bash
echo "[`date`] cdrom_id `ps -o arg= $PPID`" >> /home/endlesslove/cdroom_id.log

oldcdrom_id "$@"

It's been almost two days since then, the CD Tray didn't open anymore, but sometimes I still heard the sound of it (the sound that emits before the cd tray opens), and the cd tray's light flash at the same time (like it's about to open but somehow it just doesn't)
The script file has execute permission but there is no log file created:

$ ls -l /usr/lib/udev/cdrom_id 
-rwxr-xr-x 1 root root 113 Apr  1 21:40 /usr/lib/udev/cdrom_id
seth wrote:

There should not be two udevd processes running, so i'd focus on where the additional one's coming from.
The timing is suspicious, so would certainly be even more udev daemons (if they run along the tray interaction)

I just logged another processes list before replace cdrom_id and the time the new udev process spawns isn't extractly 1 hour after old udev process. So the time thing is maybe just coincidental (I don't know if I choose correct word here)
https://pastebin.com/M18V9gAA

seth wrote:

You should also try the behavior for a different user login and w/o i3bar (random blame since i believe it runs all sorts of sub-scripts?) - though the daemon and eject are root owned, it might still be induced by something specific to your setup.

My arch setup is exactly like the Installation guide.
Application specific config is pull from my github here: https://github.com/endless-love/dotfiles
there is nothing about cd/dvd or udev things in it .....

sad

Offline

#19 2018-04-03 12:50:35

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: CD/DVD Tray open automatically

You could add pstree (maybe 'pstree -p') to the script, that might help catch what calls cdrom_id.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#20 2018-04-05 13:14:57

Endless Love
Member
Registered: 2017-08-31
Posts: 15

Re: CD/DVD Tray open automatically

I disabled the eject button by following this thread and the cd/dvd tray no longer auto opens. And somehow the eject button still works fine lol

Offline

Board footer

Powered by FluxBB