On 02/17/2011 02:35 PM, Mark Hounschell wrote:
How does one disable/enable KDE4 from controlling my CD/DVD drives? I have some scripts that I run that fail all over the place in run-level-5 running KDE4. Something as simple as the following
eject /dev/sr0 eject -t /dev/sr0 mount /dev/sr0
will show no errors but the device will not be mounted when I go to look at the files. My fstab entry is "/dev/sr0 /mnt iso9660 ro,noauto,user 0 0". If I mount it enough times it eventually mounts. Sometimes when I "eject /dev/sr0" it even closes before I can get my media out.
All the problems I'm having are gone if running in run-level-3.
Thanks and Regards Mark
OK, it does the same at run-level-3 also so it's not KDE related I guess. Here is a simple script that bombs. It seems only in single user mode does it always work. All it does is eject the tray, ask you to insert your media into the open tray, mounts it, does an ls of the mount point, unmounts it, and then ejects the tray for media removal. I get errors from no files found to "umount: /mnt: not mounted". Then sometimes it even works as I expect it to. Why??? #!/bin/bash cleanup() { umount $DEV eject $DEV } # # make sure /dev/sr0 exists # if ! [ -b /dev/sr0 ]; then echo "No CD/DVD device at /dev/sr0 found" exit 1 else DEV="/dev/sr0" fi eject $DEV echo -n "Insert media into the CD/DVD's open tray then CR. (CR,X):" read ans case "$ans" in x) exit 0 ;; X) exit 0 ;; esac # # Mount the device # echo "Mounting $DEV" if ! mount $DEV ; then echo "Unable to mount CD/DVD on device $DEV" exit 1 else echo "Files found on CD/DVD $DEV " echo " " ls /mnt/ fi cleanup exit 0 #sh -x sh.tst + '[' -b /dev/sr0 ']' + DEV=/dev/sr0 + eject /dev/sr0 + echo -n 'Insert media into the CD/DVD'\''s open tray then CR. (CR,X):' Insert media into the CD/DVD's open tray then CR. (CR,X):+ read ans + case "$ans" in + echo 'Mounting /dev/sr0' Mounting /dev/sr0 + mount /dev/sr0 + echo 'Files found on CD/DVD /dev/sr0 ' Files found on CD/DVD /dev/sr0 + echo ' ' + ls /mnt/ + cleanup + umount /dev/sr0 umount: /mnt: not mounted + eject /dev/sr0 + exit 0 Regards Mark -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org