Univention Bugzilla – Bug 31749
cdpinger not needed anymore?
Last modified: 2014-06-12 09:19:31 CEST
Maybe we can get rid of cdpinger with the following setup. Has to be tested with a ata CDROM device, with the two USB cdrom devices and with USB sticks. --- rules.d/50-ucc-remote-mount.rules.o 2013-06-17 14:14:55.789158588 +0200 +++ rules.d/50-ucc-remote-mount.rules 2013-06-17 13:12:16.492995770 +0200 @@ -9,3 +9,7 @@ # device removals: ACTION=="remove", SUBSYSTEM=="block", RUN+="remove_fstab_entry %k" + +# device removals: +ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1", RUN+="remove_fstab_entry %k" +ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1", RUN+="add_fstab_entry %k" --- remove_fstab_entry.o 2013-06-17 14:12:22.397150481 +0200 +++ remove_fstab_entry 2013-06-17 14:12:29.573152135 +0200 @@ -38,12 +38,3 @@ umount ${MOUNTPOINT} 2>&1 >/dev/null rmdir ${MOUNTPOINT} done - - -# check for running cdpinger, and restart -pids="$(pgrep -f "cdpinger $devicename")" -if [ -n "$pids" ]; then - echo "remove_fstab_entry: restart cdpinger for $devicename" | logger - kill -9 $pids - cdpinger "$devicename" -fi if [ "${ID_TYPE}" = "cd" ]; then if [ "${ID_CDROM_MEDIA}" != "1" ]; then exit 0 fi fi --- add_fstab_entry.o 2013-06-17 14:13:29.037154335 +0200 +++ add_fstab_entry 2013-06-17 14:13:49.413155122 +0200 @@ -49,17 +49,6 @@ fi done -call_cdpinger(){ - if [ -z "$(pgrep -f -l "cdpinger $1")" ]; then - cdpinger $1 & - echo "univention-ucc-remote-mount: started cdpinger for $1"|logger - return 0 - else - # already running cdpinger for this device - return 1 - fi -} - . /usr/share/univention-lib/all.sh eval "$(univention-config-registry shell)" @@ -91,10 +80,9 @@ ## start cdpinger for the devices, cdpinger will be killed and restarted ## in remove_fstab_entry if [ "${ID_TYPE}" = "cd" ]; then - if call_cdpinger $devicename ; then - # started new cdpinger, which will handle the rest - exit 0 - fi + if [ "${ID_CDROM_MEDIA}" != "1" ]; then + exit 0 + fi fi if [ -z "$fstype" ]; then
Removed cdpinger from udev handling for CDROM devices: QA: Tests with ATA and USB CROM devices
The CD change was properly detected with the LG USB DVD drive, but the change wasn't detected with the Teac USB DVD drive. After removing the disc and closing the lid, the /run/drives/usbcd-sr0 mount point still existing (and the directory contents were listed as well, only when accessing a file it errored "file not found") So it seems the Teac drive emits a different udev event. Also, I noticed a regression when inserting a USB stick: It had a single partition, but univention-ucc-remote-mount attempted to create /run/drives/usbdisk-sdb and /run/drives/usbdisk-sdb1. The sdb mount point is empty (and should have been ignored)
(In reply to Moritz Muehlenhoff from comment #2) > The CD change was properly detected with the LG USB DVD drive, but the > change wasn't detected with the Teac USB DVD drive. > > After removing the disc and closing the lid, the /run/drives/usbcd-sr0 mount > point still existing (and the directory contents were listed as well, only > when accessing a file it errored "file not found") readded cdpinger > > So it seems the Teac drive emits a different udev event. > > Also, I noticed a regression when inserting a USB stick: It had a single > partition, but univention-ucc-remote-mount attempted to create > /run/drives/usbdisk-sdb and /run/drives/usbdisk-sdb1. The sdb mount point is > empty (and should have been ignored) fixed
(In reply to Felix Botner from comment #3) > (In reply to Moritz Muehlenhoff from comment #2) > > The CD change was properly detected with the LG USB DVD drive, but the > > change wasn't detected with the Teac USB DVD drive. > > > > After removing the disc and closing the lid, the /run/drives/usbcd-sr0 mount > > point still existing (and the directory contents were listed as well, only > > when accessing a file it errored "file not found") > > readded cdpinger Ok, disk insertions and removals could successfully be tested with both the LG and the Teac drive. > > So it seems the Teac drive emits a different udev event. > > > > Also, I noticed a regression when inserting a USB stick: It had a single > > partition, but univention-ucc-remote-mount attempted to create > > /run/drives/usbdisk-sdb and /run/drives/usbdisk-sdb1. The sdb mount point is > > empty (and should have been ignored) > > fixed Indeed, only /run/drives/usbdisk-sdb1 is mounted now. I also created a VFAT partition directly on /dev/sdb (as some Windows users do) which was also correctly mounted. Changelog not needed.
UCC 2.0 has been released: http://docs.univention.de/release-notes-ucc-2.0.html If this error occurs again, please use "Clone This Bug".