|
Lines 18-46
Link Here
|
| 18 |
start() { |
18 |
start() { |
| 19 |
ret=0 |
19 |
ret=0 |
| 20 |
# TODO do we want to separate out already active groups only? |
20 |
# TODO do we want to separate out already active groups only? |
| 21 |
VGSLIST=`$VGS --noheadings -o name 2> /dev/null` |
21 |
VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null` |
| 22 |
for vg in $VGSLIST |
22 |
ebegin "Starting LVM monitoring for VGs ${VGSLIST}:" |
| 23 |
do |
23 |
$VGCHANGE --monitor y --poll y ${VGSLIST} |
| 24 |
ebegin "Starting LVM monitoring for VG $vg:" |
24 |
ret=$? |
| 25 |
$VGCHANGE --monitor y --poll y $vg |
25 |
eend $ret |
| 26 |
ret2=$? |
|
|
| 27 |
eend $ret2 |
| 28 |
[ $ret2 -ne 0 ] && ret=$ret2 |
| 29 |
done |
| 30 |
return $ret |
26 |
return $ret |
| 31 |
} |
27 |
} |
| 32 |
|
28 |
|
| 33 |
stop() { |
29 |
stop() { |
| 34 |
ret=0 |
30 |
ret=0 |
| 35 |
# TODO do we want to separate out already active groups only? |
31 |
# TODO do we want to separate out already active groups only? |
| 36 |
VGSLIST=`$VGS --noheadings -o name 2> /dev/null` |
32 |
VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null` |
| 37 |
for vg in $VGSLIST |
33 |
ebegin "Stopping LVM monitoring for VGs ${VGSLIST}:" |
| 38 |
do |
34 |
$VGCHANGE --monitor y --poll y ${VGSLIST} |
| 39 |
ebegin "Stopping LVM monitoring for VG $vg:" |
35 |
ret=$? |
| 40 |
$VGCHANGE --monitor n $vg |
36 |
eend $ret |
| 41 |
ret2=$? |
37 |
|
| 42 |
eend $ret2 |
|
|
| 43 |
[ $ret2 -ne 0 ] && ret=$ret2 |
| 44 |
done |
| 45 |
return $ret |
38 |
return $ret |
| 46 |
} |
39 |
} |