/etc/init.d/lvm-monitoring starts and stops monitoring each lvm individually. It is possible and much quicker to change all lvms in one call to vgchange. Reproducible: Always Steps to Reproduce: 1. Install sys-fs/lvm2-2.02.97 on a system with multiple vgs 2. boot and shutdown system Actual Results: boot and shutdown completes OK but lvm-monitoring start and stop is slow (10 seconds on my system) Expected Results: boot and shutdown completes OK but lvm-monitoring start and stop is quick. diff of proposed fix: --- lvm-monitoring.initd-2.02.67-r2 2010-08-20 20:18:29.000000000 +0100 +++ /tmp/lvm-monitoring 2012-10-09 14:50:25.974888973 +0100 @@ -18,29 +18,22 @@ start() { ret=0 # TODO do we want to separate out already active groups only? - VGSLIST=`$VGS --noheadings -o name 2> /dev/null` - for vg in $VGSLIST - do - ebegin "Starting LVM monitoring for VG $vg:" - $VGCHANGE --monitor y --poll y $vg - ret2=$? - eend $ret2 - [ $ret2 -ne 0 ] && ret=$ret2 - done + VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null` + ebegin "Starting LVM monitoring for VGs ${VGSLIST}:" + $VGCHANGE --monitor y --poll y ${VGSLIST} + ret=$? + eend $ret return $ret } stop() { ret=0 # TODO do we want to separate out already active groups only? - VGSLIST=`$VGS --noheadings -o name 2> /dev/null` - for vg in $VGSLIST - do - ebegin "Stopping LVM monitoring for VG $vg:" - $VGCHANGE --monitor n $vg - ret2=$? - eend $ret2 - [ $ret2 -ne 0 ] && ret=$ret2 - done + VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null` + ebegin "Stopping LVM monitoring for VGs ${VGSLIST}:" + $VGCHANGE --monitor y --poll y ${VGSLIST} + ret=$? + eend $ret + return $ret }
Created attachment 326088 [details, diff] proposed patch to fix issue
Example output to rc.log Without patch: * Stopping LVM monitoring for VG syssda10: ... 6 logical volume(s) in volume group "syssda10" unmonitored [ ok ] * Stopping LVM monitoring for VG syssda12: ... 6 logical volume(s) in volume group "syssda12" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdb10: ... 7 logical volume(s) in volume group "syssdb10" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdb11: ... 7 logical volume(s) in volume group "syssdb11" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdb6: ... 6 logical volume(s) in volume group "syssdb6" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdb8: ... 6 logical volume(s) in volume group "syssdb8" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdb9: ... 6 logical volume(s) in volume group "syssdb9" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdc1: ... 6 logical volume(s) in volume group "syssdc1" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdc3: ... 6 logical volume(s) in volume group "syssdc3" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdc6: ... 6 logical volume(s) in volume group "syssdc6" unmonitored [ ok ] * Stopping LVM monitoring for VG syssdc7: ... 6 logical volume(s) in volume group "syssdc7" unmonitored [ ok ] * Stopping LVM monitoring for VG vgsda11: ... 1 logical volume(s) in volume group "vgsda11" unmonitored [ ok ] * Stopping LVM monitoring for VG vgsda15: ... 3 logical volume(s) in volume group "vgsda15" unmonitored [ ok ] * Stopping LVM monitoring for VG vgsdb7: ... 2 logical volume(s) in volume group "vgsdb7" unmonitored [ ok ] * Stopping LVM monitoring for VG vgsdc10: ... 3 logical volume(s) in volume group "vgsdc10" unmonitored [ ok ] * Stopping LVM monitoring for VG vgsdc2: ... 1 logical volume(s) in volume group "vgsdc2" unmonitored [ ok ] With patch: * Stopping LVM monitoring for VGs syssda10 syssda12 syssdb10 syssdb11 syssdb6 syssdb8 syssdb9 syssdc1 syssdc3 syssdc6 syssdc7 vgsda11 vgsda15 vgsdb7 vgsdc10 vgsdc2: ... 6 logical volume(s) in volume group "syssda10" monitored 6 logical volume(s) in volume group "syssda12" monitored 7 logical volume(s) in volume group "syssdb10" monitored 7 logical volume(s) in volume group "syssdb11" monitored 6 logical volume(s) in volume group "syssdb6" monitored 6 logical volume(s) in volume group "syssdb8" monitored 6 logical volume(s) in volume group "syssdb9" monitored 6 logical volume(s) in volume group "syssdc1" monitored 6 logical volume(s) in volume group "syssdc3" monitored 6 logical volume(s) in volume group "syssdc6" monitored 6 logical volume(s) in volume group "syssdc7" monitored 1 logical volume(s) in volume group "vgsda11" monitored 3 logical volume(s) in volume group "vgsda15" monitored 2 logical volume(s) in volume group "vgsdb7" monitored 3 logical volume(s) in volume group "vgsdc10" monitored 1 logical volume(s) in volume group "vgsdc2" monitored [ ok ]
Created attachment 333104 [details] corrected patch
Corrected rc.log ouput: With patch start: * Starting LVM monitoring for VGs syssda10 syssda12 syssdb10 syssdb11 syssdb6 syssdb8 syssdb9 syssdc1 syssdc3 syssdc6 syssdc7 vgsda11 vgsda15 vgsdb7 vgsdc10 vgsdc2: ... 6 logical volume(s) in volume group "syssda10" monitored 6 logical volume(s) in volume group "syssda12" monitored 7 logical volume(s) in volume group "syssdb10" monitored 7 logical volume(s) in volume group "syssdb11" monitored 6 logical volume(s) in volume group "syssdb6" monitored 6 logical volume(s) in volume group "syssdb8" monitored 6 logical volume(s) in volume group "syssdb9" monitored 6 logical volume(s) in volume group "syssdc1" monitored 6 logical volume(s) in volume group "syssdc3" monitored 6 logical volume(s) in volume group "syssdc6" monitored 6 logical volume(s) in volume group "syssdc7" monitored 1 logical volume(s) in volume group "vgsda11" monitored 3 logical volume(s) in volume group "vgsda15" monitored 2 logical volume(s) in volume group "vgsdb7" monitored 3 logical volume(s) in volume group "vgsdc10" monitored 1 logical volume(s) in volume group "vgsdc2" monitored [ ok ] With patch stop: * Stopping LVM monitoring for VGs syssda10 syssda12 syssdb10 syssdb11 syssdb6 syssdb8 syssdb9 syssdc1 syssdc3 syssdc6 syssdc7 vgsda11 vgsda15 vgsdb7 vgsdc10 vgsdc2: ... 6 logical volume(s) in volume group "syssda10" unmonitored 6 logical volume(s) in volume group "syssda12" unmonitored 7 logical volume(s) in volume group "syssdb10" unmonitored 7 logical volume(s) in volume group "syssdb11" unmonitored 6 logical volume(s) in volume group "syssdb6" unmonitored 6 logical volume(s) in volume group "syssdb8" unmonitored 6 logical volume(s) in volume group "syssdb9" unmonitored 6 logical volume(s) in volume group "syssdc1" unmonitored 6 logical volume(s) in volume group "syssdc3" unmonitored 6 logical volume(s) in volume group "syssdc6" unmonitored 6 logical volume(s) in volume group "syssdc7" unmonitored 1 logical volume(s) in volume group "vgsda11" unmonitored 3 logical volume(s) in volume group "vgsda15" unmonitored 2 logical volume(s) in volume group "vgsdb7" unmonitored 3 logical volume(s) in volume group "vgsdc10" unmonitored 1 logical volume(s) in volume group "vgsdc2" unmonitored [ ok ]
InCVS 2.02.105-r2