Bug 31749 - cdpinger not needed anymore?
cdpinger not needed anymore?
Status: CLOSED FIXED
Product: Z_Univention Corporate Client (UCC)
Classification: Unclassified
Component: Client management
unspecified
Other Linux
: P5 normal
: UCC 2.0
Assigned To: Felix Botner
Moritz Muehlenhoff
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-17 14:21 CEST by Felix Botner
Modified: 2014-06-12 09:19 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2013-06-17 14:21:24 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
Comment 1 Felix Botner univentionstaff 2014-04-07 17:13:10 CEST
Removed cdpinger from udev handling for CDROM devices:

QA: Tests with ATA and USB CROM devices
Comment 2 Moritz Muehlenhoff univentionstaff 2014-04-16 12:46:41 CEST
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)
Comment 3 Felix Botner univentionstaff 2014-04-16 15:47:04 CEST
(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
Comment 4 Moritz Muehlenhoff univentionstaff 2014-04-17 12:36:28 CEST
(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.
Comment 5 Moritz Muehlenhoff univentionstaff 2014-06-12 09:19:31 CEST
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".