1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

initscripts: lvm2-monitor: implement status action

Two new functions added in the init script: rh_status and rh_status_q.
First one to be used in status() and second one to be used in start(),
stop(), force_stop(). Check for 'dmeventd' added and print list of
lvs being monitored in status().
This commit is contained in:
Jose Castillo 2015-02-27 15:38:34 +01:00 committed by Peter Rajnoha
parent 379fb90b05
commit 57e9e76da4
2 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.117 -
====================================
Implement status action for lvm2-monitor initscript to display monitored LVs.
Allow lvchange -p to change kernel state only if metadata state differs.
Fix incorrect persistent .cache after report with label fields only (2.02.106).
Reinstate PV tag recognition for pvs if reporting label fields only (2.02.105).

View File

@ -32,18 +32,28 @@
. /etc/init.d/functions
DAEMON=lvm2-monitor
DMEVENTD_DAEMON=dmeventd
exec_prefix=@exec_prefix@
sbindir=@sbindir@
VGCHANGE=${sbindir}/vgchange
VGS=${sbindir}/vgs
LVS=${sbindir}/lvs
LOCK_FILE="/var/lock/subsys/$DAEMON"
PID_FILE="/var/run/dmeventd.pid"
WARN=1
export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
rh_status() {
status -p $PID_FILE $DMEVENTD_DAEMON
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
start()
{
ret=0
@ -79,12 +89,14 @@ rtrn=1
# See how we were called.
case "$1" in
start)
rh_status_q && exit 0
start
rtrn=$?
[ $rtrn = 0 ] && touch $LOCK_FILE
;;
force-stop)
rh_status_q || exit 0
WARN=0
stop
rtrn=$?
@ -92,6 +104,7 @@ case "$1" in
;;
stop)
rh_status_q || exit 0
test "$runlevel" = "0" && WARN=0
test "$runlevel" = "6" && WARN=0
stop
@ -109,7 +122,9 @@ case "$1" in
;;
status)
# TODO anyone with an idea how to dump monitored volumes?
rh_status
rtrn=$?
[ $rtrn = 0 ] && $LVS -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor
;;
*)