Advise user to close the CD tray if necessary

Bug #13023 reported by Jean Privat
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
Fix Released
Low
Matt Zimmerman

Bug Description

On the live CD array-5, on shutdown/reboot, the disk is ejected and the computer
ask you to press enter then halt/reboot. Maybe he have to close the cd reader
just after enter is pressed.

Revision history for this message
Juanje Ojeda (juanje) wrote :

It depends of the device, but anyway there is a interface to deal with that in
the /proc:
/proc/sys/dev/cdrom/autoclose
/proc/sys/dev/cdrom/lock
/proc/sys/dev/cdrom/autoeject

And there is a eject's option to close:
eject -t
Something like:
<patch-0>
--- casper-udeb/usr/share/casper/shutdown 2005-03-04 18:38:19.000000000 +0000
+++ casper-udeb_new/usr/share/casper/shutdown 2005-03-04 23:15:29.189829983 +0000
@@ -37,4 +37,6 @@
 echo -n "Please remove the disc and press ENTER: "
 read x

+eject -t
+
 exit 0
</patch-0>

But I'd like to change the current code to something like:
<patch-1>
--- casper-udeb/usr/share/casper/shutdown 2005-03-04 18:38:19.000000000 +0000
+++ casper-udeb_new/usr/share/casper/shutdown 2005-03-04 23:11:41.970298224 +0000
@@ -31,7 +31,9 @@
     cache_path "$path"
 done

-eject -p -m /cdrom
+echo 0 > /proc/sys/dev/cdrom/lock
+echo 1 > /proc/sys/dev/cdrom/autoeject
+echo 1 > /proc/sys/dev/cdrom/autoclose

 # XXX - i18n
 echo -n "Please remove the disc and press ENTER: "
</patch-1>

OR

<patch-2>
--- casper-udeb/usr/share/casper/shutdown 2005-03-04 18:38:19.000000000 +0000
+++ casper-udeb_new/usr/share/casper/shutdown 2005-03-04 23:13:17.353186475 +0000
@@ -31,7 +31,9 @@
     cache_path "$path"
 done

-eject -p -m /cdrom
+sysctl -w dev.cdrom.lock=0
+sysctl -w dev.cdrom.autoeject=1
+sysctl -w dev.cdrom.autoclose=1

 # XXX - i18n
 echo -n "Please remove the disc and press ENTER: "
</patch-2>

And after any cdrom device who is umounted open byself and after, it's suppesed
to close. But of course, that depends fo the device..... not all the devices
support that :(

Revision history for this message
Juanje Ojeda (juanje) wrote :

Well, actually the first patch could be simpler as:
<patch-0>
--- casper-udeb/usr/share/casper/shutdown 2005-03-04 18:38:19.000000000 +0000
+++ casper-udeb_new/usr/share/casper/shutdown 2005-03-04 23:47:25.947568356 +0000
@@ -31,7 +31,7 @@
     cache_path "$path"
 done

-eject -p -m /cdrom
+eject -t -p -m /cdrom

 # XXX - i18n
 echo -n "Please remove the disc and press ENTER: "
</patch-0>

But I couldn't try. Anyway I think the other way work better, I mean the procfs one.

Revision history for this message
Juanje Ojeda (juanje) wrote :

Sorry, I guess I put RESOLVED too soon. I just beliable that those patch resolve
the problem, but I din't wait to somebody else see the patchs and apply them if
they are right.
I reopen it in case someone with rights put the resolution and fix the problem.

Sorry and thanks

Revision history for this message
Matt Zimmerman (mdz) wrote :

I already fixed this bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.