On Thu, Jun 24, 2004 at 02:13:57PM -0400, Joey Hess wrote:
> Osamu Aoki wrote:
> > Applying above patch should give releaf to many old DELL users. Of
> > course we should do some code clean up such as redirecting output to
> > /dev/null instead.
>
> Or to syslog. I'd be gad to apply this patch if you do that, I don't
> like the /error.log stuff.
Well some error outputs were going to /dev/null originally.
Are you thinking like:
----------------------------------------------------------------------
--- cdrom-detect.postinst.org 1970-01-01 01:00:00.000000000 +0100
+++ cdrom-detect.postinst 2004-06-24 22:39:25.000000000 +0200
@@ -42,9 +42,24 @@
do
if mount -t iso9660 -o ro,exec $device /cdrom 2>/dev/null
then
+ log "CDROM-mount succeeded at the first try."
mounted=1
- db_set cdrom-detect/cdrom_device $device
+ db_set cdrom-detect/cdrom_device $device
break
+ else
+ log "CDROM-mount failed (error=$?)."
+ log "$(echo "Unmounting CD..." ; umount /cdrom 2>&1 || true)"
+ sleep 1 || true
+ if mount -t iso9660 -o ro,exec $device /cdrom 2>/dev/null
+ then
+ log "CDROM-mount succeeded at the second try."
+ mounted=1
+ db_set cdrom-detect/cdrom_device $device
+ break
+ else
+ log "CDROM-mount failed again (error=$?)."
+ log "$(echo "Unmounting CD..." ; umount /cdrom 2>&1 || true)"
+ fi
fi
done
@@ -111,8 +126,12 @@
fi
if mount -t iso9660 -o ro,exec $device /cdrom
then
+ log "CDROM-mount succeeded with device=$device."
mounted=1
break
+ else
+ log "CDROM-mount failed with device=$device (error=$?)."
+ log "$(echo "Unmounting CD..." ; umount /cdrom 2>&1 || true)"
fi
else
fail
----------------------------------------------------------------------
I was not sure I should add "2>/dev/null" for the last
"if mount -t iso9660 -o ro,exec $device /cdrom".
I was not sure I can add "| logger" after "if mount ..." either.
Also, I wish I could add a screen display stating "Trying again".
Otherwise, it takes forever especially with 1 second pause as Vince
complained. I never used debconf.
Osamu
Attachment:
signature.asc
Description: Digital signature