mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Add warning to lvm2_monitoring_init_rhel4 if attempting to stop monitoring.
This commit is contained in:
parent
ce4c33102f
commit
319e74e2da
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.21 -
|
Version 2.02.21 -
|
||||||
===================================
|
===================================
|
||||||
|
Add warning to lvm2_monitoring_init_rhel4 if attempting to stop monitoring.
|
||||||
Fix vgsplit to handle mirrors.
|
Fix vgsplit to handle mirrors.
|
||||||
Reorder fields in reporting field definitions.
|
Reorder fields in reporting field definitions.
|
||||||
Fix vgs to treat args as VGs even when PV fields are displayed.
|
Fix vgs to treat args as VGs even when PV fields are displayed.
|
||||||
|
@ -25,11 +25,11 @@
|
|||||||
. /etc/init.d/functions
|
. /etc/init.d/functions
|
||||||
|
|
||||||
VGCHANGE="/usr/sbin/vgchange"
|
VGCHANGE="/usr/sbin/vgchange"
|
||||||
|
WARN=1
|
||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
for ret in 0
|
ret=0
|
||||||
do
|
|
||||||
# TODO do we want to separate out already active groups only?
|
# TODO do we want to separate out already active groups only?
|
||||||
VGS=`vgs --noheadings -o name`
|
VGS=`vgs --noheadings -o name`
|
||||||
for vg in $VGS
|
for vg in $VGS
|
||||||
@ -40,50 +40,58 @@ start()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stop()
|
stop()
|
||||||
{
|
{
|
||||||
for ret in 0
|
ret=0
|
||||||
do
|
|
||||||
# TODO do we want to separate out already active groups only?
|
# TODO do we want to separate out already active groups only?
|
||||||
|
if test "$WARN" = "1"; then
|
||||||
|
echo "Not stopping monitoring, this is a dangerous operation. Please use force-stop to override."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
VGS=`vgs --noheadings -o name`
|
VGS=`vgs --noheadings -o name`
|
||||||
for vg in $VGS
|
for vg in $VGS
|
||||||
do
|
do
|
||||||
if ! action "Starting monitoring for VG $vg:" $VGCHANGE --monitor n $vg
|
if ! action "Stopping monitoring for VG $vg:" $VGCHANGE --monitor n $vg
|
||||||
then
|
then
|
||||||
ret=$?
|
ret=$?
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
return $ret
|
||||||
done
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret=1
|
result=1
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
start
|
start
|
||||||
ret=$?
|
result=$?
|
||||||
|
;;
|
||||||
|
|
||||||
|
force-stop)
|
||||||
|
WARN=0
|
||||||
|
stop
|
||||||
|
result=$?
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
|
test "$runlevel" = "0" && WARN=0
|
||||||
|
test "$runlevel" = "6" && WARN=0
|
||||||
stop
|
stop
|
||||||
ret=$?
|
result=$?
|
||||||
;;
|
;;
|
||||||
|
|
||||||
restart)
|
restart)
|
||||||
|
WARN=0
|
||||||
if stop
|
if stop
|
||||||
then
|
then
|
||||||
start
|
start
|
||||||
fi
|
fi
|
||||||
ret=$?
|
result=$?
|
||||||
;;
|
;;
|
||||||
|
|
||||||
status)
|
status)
|
||||||
@ -91,8 +99,8 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo $"Usage: $0 {start|stop|restart|status}"
|
echo $"Usage: $0 {start|stop|restart|status|force-stop}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit $ret
|
exit $result
|
||||||
|
Loading…
Reference in New Issue
Block a user