1 diff -ur LVM2.2.02.132.orig/scripts/blk_availability_init_red_hat.in LVM2.2.02.132/scripts/blk_availability_init_red_hat.in
2 --- LVM2.2.02.132.orig/scripts/blk_availability_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000
3 +++ LVM2.2.02.132/scripts/blk_availability_init_red_hat.in 2015-10-05 12:31:30.991042000 +0000
8 # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
12 . /etc/init.d/functions
16 -options="-u -l wholevg"
17 +DAEMON="blkdeactivate"
18 +OPTIONS="-u -l wholevg"
20 LOCK_FILE="/var/lock/subsys/blk-availability"
32 - action "Stopping block device availability:" $sbindir/$script $options
33 + run_cmd "Stopping block device availability:" /sbin/$DAEMON $OPTIONS
42 - echo $"Usage: $0 {start|stop|status}"
43 + msg_usage "$0 {start|stop|status}"
47 diff -ur LVM2.2.02.132.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.132/scripts/clvmd_init_red_hat.in
48 --- LVM2.2.02.132.orig/scripts/clvmd_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000
49 +++ LVM2.2.02.132/scripts/clvmd_init_red_hat.in 2015-10-05 19:20:56.249042000 +0000
52 . /etc/rc.d/init.d/functions
57 -exec_prefix=@exec_prefix@
60 -lvm_vgchange=${sbindir}/vgchange
61 -lvm_vgs=${sbindir}/vgs
62 -lvm_vgscan=${sbindir}/vgscan
63 -lvm_lvs=${sbindir}/lvs
64 +lvm_vgchange="/sbin/vgchange"
66 +lvm_vgscan="/sbin/vgscan"
72 ${lvm_lvs} --noheadings -o lv_name -S 'vg_clustered=1 && lv_active!=""' 2>/dev/null
80 - rh_status >/dev/null 2>&1
85 - if ! rh_status_q; then
86 - echo -n "Starting $DAEMON: "
87 + if ! status $DAEMON 1>/dev/null 2>&1; then
88 + msg_starting "$DAEMON"
89 $DAEMON $CLVMDOPTS || return $?
93 # Refresh local cache.
95 # unnecessary warnings.
97 ${lvm_vgscan} > /dev/null 2>&1
99 - action "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $?
101 + run_cmd "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $?
110 - while [ "$count" -le "$CLVMD_STOP_TIMEOUT" ] && \
112 + while [ "$count" -le "$CLVMD_STOP_TIMEOUT" ] && status $DAEMON 1>/dev/null 2>&1 ; do
118 + ! status $DAEMON 1>/dev/null 2>&1
123 - rh_status_q || return 0
124 + status $DAEMON 1>/dev/null 2>&1 || return 0
126 [ -z "$LVM_VGS" ] && LVM_VGS="$(clustered_vgs)"
127 if [ -n "$LVM_VGS" ]; then
128 - action "Deactivating clustered VG(s):" ${lvm_vgchange} -anl $LVM_VGS || return $?
129 + run_cmd "Deactivating clustered VG(s):" ${lvm_vgchange} -anl $LVM_VGS || return $?
132 - action "Signaling $DAEMON to exit" kill -TERM $(pidofproc $DAEMON) || return $?
133 + run_cmd "Signaling $DAEMON to exit" kill -TERM $(pidofproc $DAEMON) || return $?
135 # wait half second before we start the waiting loop or we will show
136 # the loop more time than really necessary
139 # clvmd could take some time to stop
140 - rh_status_q && action "Waiting for $DAEMON to exit:" wait_for_finish
142 - if rh_status_q; then
143 - echo -n "$DAEMON failed to exit"
146 + status $DAEMON 1>/dev/null 2>&1 && run_cmd "Waiting for $DAEMON to exit:" wait_for_finish
147 + if status $DAEMON 1>/dev/null 2>&1; then
151 - echo -n "$DAEMON terminated"
163 - rh_status_q || exit 7
164 - action "Reloading $DAEMON configuration: " $DAEMON -R || return $?
165 + status $DAEMON 1>/dev/null 2>&1 || exit 7
166 + run_cmd "Reloading $DAEMON configuration: " $DAEMON -R || return $?
170 # if stop fails, restart will return the error and not attempt
171 - # another start. Even if start is protected by rh_status_q,
172 + # another start. Even if start is protected by status call,
173 # that would avoid spawning another daemon, it would try to
174 # reactivate the VGs.
176 # Try to get clvmd to restart itself. This will preserve
178 - action "Restarting $DAEMON: " $DAEMON -S
179 + run_cmd "Restarting $DAEMON: " $DAEMON -S
181 # If that fails then do a normal stop & restart
183 @@ -166,49 +142,43 @@
188 # See how we were called.
202 restart|force-reload)
208 condrestart|try-restart)
209 - rh_status_q || exit 0
210 + status $DAEMON 1>/dev/null 2>&1 || exit 0
225 - if [ $rtrn = 0 ]; then
228 + if [ $RETVAL = 0 ]; then
229 cvgs="$(clustered_vgs)"
230 echo Clustered Volume Groups: ${cvgs:-"(none)"}
231 clvs="$(clustered_active_lvs)"
232 echo Active clustered Logical Volumes: ${clvs:-"(none)"}
237 - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
239 + msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
246 diff -ur LVM2.2.02.132.orig/scripts/lvm2_lvmetad_init_red_hat.in LVM2.2.02.132/scripts/lvm2_lvmetad_init_red_hat.in
247 --- LVM2.2.02.132.orig/scripts/lvm2_lvmetad_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000
248 +++ LVM2.2.02.132/scripts/lvm2_lvmetad_init_red_hat.in 2015-10-05 12:31:30.993042000 +0000
253 # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
257 . /etc/init.d/functions
261 -exec_prefix=@exec_prefix@
264 +NAME="LVM metadata daemon"
266 LOCK_FILE="/var/lock/subsys/$DAEMON"
267 PID_FILE="@LVMETAD_PIDFILE@"
270 - status -p $PID_FILE $DAEMON
272 + if [ -f $LOCK_FILE ]; then
273 + msg_already_running $NAME
277 + daemon /sbin/$DAEMON </dev/null
279 + [ $RETVAL -eq 0 ] && touch $LOCK_FILE
283 - rh_status >/dev/null 2>&1
285 + if [ ! -f $LOCK_FILE ]; then
286 + msg_not_running $NAME
290 + killproc --pidfile $PID_FILE $DAEMON
297 - action "Starting LVM metadata daemon:" $DAEMON || ret=$?
300 + if [ ! -f $LOCK_FILE ]; then
301 + msg_not_running $NAME
313 - action "Signaling LVM metadata daemon to exit:" killproc -p $PID_FILE $DAEMON -TERM || ret=$?
316 + if [ ! -f $LOCK_FILE ]; then
317 + msg_not_running $NAME
321 + msg_reloading $NAME
322 + killproc $DAEMON -HUP
329 # See how we were called.
332 - rh_status_q && exit 0
335 - [ $rtrn = 0 ] && touch $LOCK_FILE
339 - rh_status_q || exit 0
343 - [ $rtrn = 0 ] && rm -f $LOCK_FILE
356 condrestart|try-restart)
357 - rh_status_q || exit 0
374 - echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
375 + msg_usage "$0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
381 diff -ur LVM2.2.02.132.orig/scripts/lvm2_lvmpolld_init_red_hat.in LVM2.2.02.132/scripts/lvm2_lvmpolld_init_red_hat.in
382 --- LVM2.2.02.132.orig/scripts/lvm2_lvmpolld_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000
383 +++ LVM2.2.02.132/scripts/lvm2_lvmpolld_init_red_hat.in 2015-10-05 12:31:30.993042000 +0000
388 -# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
389 +# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
391 # This copyrighted material is made available to anyone wishing to use,
392 # modify, copy, or redistribute it subject to the terms and conditions
394 # Default-Start: 1 2 3 4 5
396 # Short-Description: A daemon that is responsible for monitoring in-progress
397 -# and possibly longer term operations on logical volumes.
398 -# It helps to reduce the number of spawned processes if same
399 +# and possibly longer term operations on logical volumes.
400 +# It helps to reduce the number of spawned processes if same
401 # logical volume is requested to get monitored multiple times.
402 # Also avoids unsolicited termination due to external factors.
405 . /etc/init.d/functions
409 -exec_prefix=@exec_prefix@
412 +NAME="LVM poll daemon"
414 LOCK_FILE="/var/lock/subsys/$DAEMON"
415 PID_FILE="@LVMPOLLD_PIDFILE@"
418 - status -p $PID_FILE $DAEMON
420 + if [ -f $LOCK_FILE ]; then
421 + msg_already_running $NAME
425 + daemon /sbin/$DAEMON </dev/null
427 + [ $RETVAL -eq 0 ] && touch $LOCK_FILE
431 - rh_status >/dev/null 2>&1
433 + if [ ! -f $LOCK_FILE ]; then
434 + msg_not_running $NAME
438 + killproc --pidfile $PID_FILE $DAEMON
445 - action "Starting LVM poll daemon:" $DAEMON || ret=$?
448 + if [ ! -f $LOCK_FILE ]; then
449 + msg_not_running $NAME
461 - action "Signaling LVM poll daemon to exit:" killproc -p $PID_FILE $DAEMON -TERM || ret=$?
464 + if [ ! -f $LOCK_FILE ]; then
465 + msg_not_running $NAME
469 + msg_reloading $NAME
470 + killproc $DAEMON -HUP
477 # See how we were called.
480 - rh_status_q && exit 0
483 - [ $rtrn = 0 ] && touch $LOCK_FILE
487 - rh_status_q || exit 0
491 - [ $rtrn = 0 ] && rm -f $LOCK_FILE
504 condrestart|try-restart)
505 - rh_status_q || exit 0
522 - echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
523 + msg_usage "$0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
529 diff -ur LVM2.2.02.132.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.02.132/scripts/lvm2_monitoring_init_red_hat.in
530 --- LVM2.2.02.132.orig/scripts/lvm2_monitoring_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000
531 +++ LVM2.2.02.132/scripts/lvm2_monitoring_init_red_hat.in 2015-10-05 12:32:01.204042000 +0000
536 # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
540 . /etc/init.d/functions
543 -DMEVENTD_DAEMON=dmeventd
544 +DAEMON="lvm2-monitor"
545 +DMEVENTD_DAEMON="dmeventd"
547 -exec_prefix=@exec_prefix@
550 -VGCHANGE=${sbindir}/vgchange
553 +VGCHANGE="/sbin/vgchange"
557 LOCK_FILE="/var/lock/subsys/$DAEMON"
558 PID_FILE="@DMEVENTD_PIDFILE@"
561 export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
564 - status -p $PID_FILE $DMEVENTD_DAEMON
568 - rh_status >/dev/null 2>&1
573 + local config="'log{command_names=0 prefix=\" \"}'"
574 # TODO do we want to separate out already active groups only?
575 - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null`
576 + VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config $config 2> /dev/null`
579 - action "Starting monitoring for VG $vg:" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$?
580 + run_cmd "Starting monitoring for LVM VG $vg" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config $config $vg
590 + local config="'log{command_names=0 prefix=\" \"}'"
591 # TODO do we want to separate out already active groups only?
592 if test "$WARN" = "1"; then
593 echo "Not stopping monitoring, this is a dangerous operation. Please use force-stop to override."
596 - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null`
597 + VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config ${config} 2> /dev/null`
600 - action "Stopping monitoring for VG $vg:" $VGCHANGE --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$?
601 + run_cmd "Stopping monitoring for LVM VG $vg" $VGCHANGE --monitor n --ignoreskippedcluster --config $config $vg
609 # See how we were called.
612 - rh_status_q && exit 0
613 + status $DMEVENTD_DAEMON 1>/dev/null 2>&1 && exit 0
616 - [ $rtrn = 0 ] && touch $LOCK_FILE
618 + [ $RETVAL = 0 ] && touch $LOCK_FILE
622 - rh_status_q || exit 0
623 + status $DMEVENTD_DAEMON 1>/dev/null 2>&1 || exit 0
627 - [ $rtrn = 0 ] && rm -f $LOCK_FILE
629 + [ $RETVAL = 0 ] && rm -f $LOCK_FILE
633 - rh_status_q || exit 0
634 + status $DMEVENTD_DAEMON 1>/dev/null 2>&1 || exit 0
635 test "$runlevel" = "0" && WARN=0
636 test "$runlevel" = "6" && WARN=0
639 - [ $rtrn = 0 ] && rm -f $LOCK_FILE
641 + [ $RETVAL = 0 ] && rm -f $LOCK_FILE
658 - [ $rtrn = 0 ] && $LVS -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor
659 + status $DMEVENTD_DAEMON
661 + [ $RETVAL = 0 ] && $LVS -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor
665 - echo $"Usage: $0 {start|stop|restart|status|force-stop}"
666 + msg_usage "$0 {start|stop|restart|status|force-stop}"