1 diff -urp LVM2.2.02.177.orig/scripts/blk_availability_init_red_hat.in LVM2.2.02.177/scripts/blk_availability_init_red_hat.in
2 --- LVM2.2.02.177.orig/scripts/blk_availability_init_red_hat.in 2017-12-18 20:44:35.000000000 +0000
3 +++ LVM2.2.02.177/scripts/blk_availability_init_red_hat.in 2018-01-29 11:24:46.012906501 +0000
8 # Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved.
12 . /etc/init.d/functions
15 +DAEMON="blkdeactivate"
16 +OPTIONS="-u -l wholevg -m disablequeueing"
19 -options="-u -l wholevg -m disablequeueing -r wait"
21 -LOCK_FILE="@DEFAULT_LOCK_DIR@/subsys/blk-availability"
22 +LOCK_FILE="/var/lock/subsys/blk-availability"
31 - action "Stopping block device availability:" "$sbindir/$script" $options
32 + 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 -urp LVM2.2.02.177.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.177/scripts/clvmd_init_red_hat.in
48 --- LVM2.2.02.177.orig/scripts/clvmd_init_red_hat.in 2017-12-18 20:44:35.000000000 +0000
49 +++ LVM2.2.02.177/scripts/clvmd_init_red_hat.in 2018-01-29 12:54:59.156583852 +0000
53 # description: Cluster daemon for userland logical volume management tools.
54 -# pidfile: @CLVMD_PIDFILE@
55 +# pidfile: /var/run/clvmd.pid
57 # For Red-Hat-based distributions such as Fedora, RHEL, CentOS.
61 . /etc/rc.d/init.d/functions
67 -usrsbindir="@USRSBINDIR@"
69 -lvm_vgchange="$sbindir/vgchange"
70 -lvm_vgs="$sbindir/vgs"
71 -lvm_vgscan="$sbindir/vgscan"
72 -lvm_lvs="$sbindir/lvs"
73 +lvm_vgchange="/sbin/vgchange"
75 +lvm_vgscan="/sbin/vgscan"
80 @@ -50,20 +47,11 @@ clustered_active_lvs() {
81 "$lvm_lvs" --noheadings -o lv_name -S 'vg_clustered=1 && lv_active!=""' 2>/dev/null
89 - rh_status >/dev/null 2>&1
94 - if ! rh_status_q; then
95 - echo -n "Starting $DAEMON: "
96 - "$usrsbindir/$DAEMON" $CLVMDOPTS || return $?
98 + if ! status $DAEMON 1>/dev/null 2>&1; then
99 + msg_starting "$DAEMON"
100 + "$DAEMON" $CLVMDOPTS || return $?
103 # Refresh local cache.
104 @@ -82,74 +70,60 @@ start()
105 # unnecessary warnings.
107 "$lvm_vgscan" > /dev/null 2>&1
109 - action "Activating VG(s):" "$lvm_vgchange" -aay $LVM_VGS || return $?
111 + run_cmd "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $?
120 - while [ "$count" -le "$CLVMD_STOP_TIMEOUT" ] && \
122 + while [ "$count" -le "$CLVMD_STOP_TIMEOUT" ] && status $DAEMON 1>/dev/null 2>&1 ; do
128 + ! status $DAEMON 1>/dev/null 2>&1
133 - rh_status_q || return 0
135 + status $DAEMON 1>/dev/null 2>&1 || return 0
136 [ -z "$LVM_VGS" ] && LVM_VGS="$(clustered_vgs)"
137 if [ -n "$LVM_VGS" ]; then
138 - action "Deactivating clustered VG(s):" "$lvm_vgchange" -anl $LVM_VGS || return $?
139 + run_cmd "Deactivating clustered VG(s):" ${lvm_vgchange} -anl $LVM_VGS || return $?
142 - action "Signaling $DAEMON to exit" kill -TERM "$(pidofproc "$DAEMON")" || return $?
143 + run_cmd "Signaling $DAEMON to exit" kill -TERM $(pidofproc "$DAEMON") || return $?
145 # wait half second before we start the waiting loop or we will show
146 # the loop more time than really necessary
149 # clvmd could take some time to stop
150 - rh_status_q && action "Waiting for $DAEMON to exit:" wait_for_finish
152 - if rh_status_q; then
153 - echo -n "$DAEMON failed to exit"
156 + status $DAEMON 1>/dev/null 2>&1 && run_cmd "Waiting for $DAEMON to exit:" wait_for_finish
157 + if status $DAEMON 1>/dev/null 2>&1; then
161 - echo -n "$DAEMON terminated"
173 - rh_status_q || exit 7
174 - action "Reloading $DAEMON configuration: " "$usrsbindir/$DAEMON" -R || return $?
175 + status $DAEMON 1>/dev/null 2>&1 || exit 7
176 + run_cmd "Reloading $DAEMON configuration: " "$DAEMON" -R || return $?
180 # if stop fails, restart will return the error and not attempt
181 - # another start. Even if start is protected by rh_status_q,
182 + # another start. Even if start is protected by status call,
183 # that would avoid spawning another daemon, it would try to
184 # reactivate the VGs.
186 # Try to get clvmd to restart itself. This will preserve
188 - action "Restarting $DAEMON: " "$usrsbindir/$DAEMON" -S
189 + run_cmd "Restarting $DAEMON: " "$DAEMON" -S
191 # If that fails then do a normal stop & restart
193 @@ -166,38 +140,39 @@ restart() {
198 # See how we were called.
212 restart|force-reload)
218 condrestart|try-restart)
219 - rh_status_q || exit 0
220 + status $DAEMON 1>/dev/null 2>&1 || exit 0
235 - if [ "$rtrn" = 0 ]; then
238 + if [ $RETVAL = 0 ]; then
239 cvgs="$(clustered_vgs)"
240 echo Clustered Volume Groups: ${cvgs:-"(none)"}
241 clvs="$(clustered_active_lvs)"
242 @@ -206,9 +181,9 @@ case "$1" in
246 - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
248 + msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
255 diff -urp LVM2.2.02.177.orig/scripts/cmirrord_init_red_hat.in LVM2.2.02.177/scripts/cmirrord_init_red_hat.in
256 --- LVM2.2.02.177.orig/scripts/cmirrord_init_red_hat.in 2017-12-18 20:44:35.000000000 +0000
257 +++ LVM2.2.02.177/scripts/cmirrord_init_red_hat.in 2018-01-29 11:28:49.069892013 +0000
261 # description: Starts and stops cmirrord
262 -# pidfile: @CMIRRORD_PIDFILE@
263 +# pidfile: /var/run/cmirrord.pid
265 # For Red-Hat-based distributions such as Fedora, RHEL, CentOS.
269 . /etc/init.d/functions
274 -usrsbindir="@USRSBINDIR@"
276 -LOCK_FILE="@DEFAULT_SYS_LOCK_DIR@/subsys/$DAEMON"
277 +LOCK_FILE="/var/lock/subsys/$DAEMON"
282 - if ! pidof "$DAEMON" > /dev/null
284 - echo -n "Starting $DAEMON: "
285 - daemon "$usrsbindir/$DAEMON"
291 + if [ -f $LOCK_FILE ]; then
292 + msg_already_running "$DAEMON"
295 + msg_starting "$DAEMON"
296 + daemon /sbin/$DAEMON </dev/null
298 + [ $RETVAL -eq 0 ] && touch "$LOCK_FILE"
303 - echo -n "Stopping $DAEMON:"
304 - killproc "$DAEMON" -TERM
315 - while [ "$count" -le 10 -a -n "`pidof $DAEMON`" ]
318 - count=$((count + 1))
321 - if [ "$(pidof "$DAEMON")" ]
326 + if [ ! -f $LOCK_FILE ]; then
327 + msg_not_running "$DAEMON"
330 + msg_stopping "$DAEMON"
331 + killproc --pidfile "$PID_FILE" "$DAEMON"
343 # See how we were called.
348 - [ "$rtrn" = 0 ] && touch "$LOCK_FILE"
354 - [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE"
371 - if [ "$rtrn" -eq 0 ]; then
372 - echo "cmirror is running."
379 - echo $"Usage: $0 {start|stop|restart|status}"
380 + msg_usage "$0 {start|stop|restart|status}"
386 diff -urp LVM2.2.02.177.orig/scripts/lvm2_lvmetad_init_red_hat.in LVM2.2.02.177/scripts/lvm2_lvmetad_init_red_hat.in
387 --- LVM2.2.02.177.orig/scripts/lvm2_lvmetad_init_red_hat.in 2017-12-18 20:44:35.000000000 +0000
388 +++ LVM2.2.02.177/scripts/lvm2_lvmetad_init_red_hat.in 2018-01-29 11:30:04.229887533 +0000
393 # Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved.
397 . /etc/init.d/functions
401 +NAME="LVM metadata daemon"
405 -LOCK_FILE="@DEFAULT_SYS_LOCK_DIR@/subsys/$DAEMON"
406 -PID_FILE="@LVMETAD_PIDFILE@"
409 - status -p "$PID_FILE" "$DAEMON"
413 - rh_status >/dev/null 2>&1
415 +LOCK_FILE="/var/lock/subsys/lvm2-lvmetad"
416 +PID_FILE="/var/run/lvmetad.pid"
421 - action "Starting LVM metadata daemon:" "$sbindir/$DAEMON" || ret=$?
423 + if [ -f "$LOCK_FILE" ]; then
424 + msg_already_running "$NAME"
427 + msg_starting "$NAME"
428 + daemon "/sbin/$DAEMON" </dev/null
430 + [ "$RETVAL" -eq 0 ] && touch "$LOCK_FILE"
436 - action "Signaling LVM metadata daemon to exit:" killproc -p "$PID_FILE" "$DAEMON" -TERM || ret=$?
438 + if [ ! -f "$LOCK_FILE" ]; then
439 + msg_not_running "$NAME"
442 + msg_stopping "$NAME"
443 + killproc --pidfile "$PID_FILE" "$DAEMON"
448 + if [ ! -f "$LOCK_FILE" ]; then
449 + msg_not_running "$NAME"
459 + if [ ! -f "$LOCK_FILE" ]; then
460 + msg_not_running "$NAME"
464 + msg_reloading "$NAME"
465 + killproc "$DAEMON" -HUP
470 # See how we were called.
473 - rh_status_q && exit 0
476 - [ "$rtrn" = 0 ] && touch "$LOCK_FILE"
480 - rh_status_q || exit 0
484 - [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE"
497 condrestart|try-restart)
498 - rh_status_q || exit 0
515 - echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
516 + msg_usage "$0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
522 diff -urp LVM2.2.02.177.orig/scripts/lvm2_lvmpolld_init_red_hat.in LVM2.2.02.177/scripts/lvm2_lvmpolld_init_red_hat.in
523 --- LVM2.2.02.177.orig/scripts/lvm2_lvmpolld_init_red_hat.in 2017-12-18 20:44:35.000000000 +0000
524 +++ LVM2.2.02.177/scripts/lvm2_lvmpolld_init_red_hat.in 2018-01-29 11:31:12.405883470 +0000
529 -# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
530 +# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
532 # This copyrighted material is made available to anyone wishing to use,
533 # modify, copy, or redistribute it subject to the terms and conditions
535 # Default-Start: 1 2 3 4 5
537 # Short-Description: A daemon that is responsible for monitoring in-progress
538 -# and possibly longer term operations on logical volumes.
539 -# It helps to reduce the number of spawned processes if same
540 +# and possibly longer term operations on logical volumes.
541 +# It helps to reduce the number of spawned processes if same
542 # logical volume is requested to get monitored multiple times.
543 # Also avoids unsolicited termination due to external factors.
546 . /etc/init.d/functions
550 +NAME="LVM poll daemon"
554 -LOCK_FILE="@DEFAULT_LOCK_DIR@/subsys/$DAEMON"
555 -PID_FILE="@LVMPOLLD_PIDFILE@"
558 - status -p "$PID_FILE" "$DAEMON"
562 - rh_status >/dev/null 2>&1
564 +LOCK_FILE="/var/lock/subsys/lvm2-lvmpolld"
565 +PID_FILE="/var/run/lvmpolld.pid"
570 - action "Starting LVM poll daemon:" "$sbindir/$DAEMON" || ret=$?
572 + if [ -f $LOCK_FILE ]; then
573 + msg_already_running "$NAME"
576 + msg_starting "$NAME"
577 + daemon "/sbin/$DAEMON" </dev/null
579 + [ "$RETVAL" -eq 0 ] && touch "$LOCK_FILE"
585 - action "Signaling LVM poll daemon to exit:" killproc -p "$PID_FILE" "$DAEMON" -TERM || ret=$?
587 + if [ ! -f "$LOCK_FILE" ]; then
588 + msg_not_running "$NAME"
591 + msg_stopping "$NAME"
592 + killproc --pidfile "$PID_FILE" "$DAEMON"
597 + if [ ! -f "$LOCK_FILE" ]; then
598 + msg_not_running "$NAME"
608 + if [ ! -f "$LOCK_FILE" ]; then
609 + msg_not_running "$NAME"
613 + msg_reloading "$NAME"
614 + killproc "$DAEMON" -HUP
619 # See how we were called.
622 - rh_status_q && exit 0
625 - [ $rtrn = 0 ] && touch "$LOCK_FILE"
629 - rh_status_q || exit 0
633 - [ $rtrn = 0 ] && rm -f "$LOCK_FILE"
646 condrestart|try-restart)
647 - rh_status_q || exit 0
664 - echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
665 + msg_usage "$0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
671 diff -urp LVM2.2.02.177.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.02.177/scripts/lvm2_monitoring_init_red_hat.in
672 --- LVM2.2.02.177.orig/scripts/lvm2_monitoring_init_red_hat.in 2017-12-18 20:44:35.000000000 +0000
673 +++ LVM2.2.02.177/scripts/lvm2_monitoring_init_red_hat.in 2018-01-29 11:33:20.925875809 +0000
678 # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
682 . /etc/init.d/functions
685 -DMEVENTD_DAEMON=dmeventd
686 +DAEMON="lvm2-monitor"
687 +DMEVENTD_DAEMON="dmeventd"
690 +VGCHANGE="/sbin/vgchange"
694 -VGCHANGE="$sbindir/vgchange"
698 -LOCK_FILE="@DEFAULT_SYS_LOCK_DIR@/subsys/$DAEMON"
699 -PID_FILE="@DMEVENTD_PIDFILE@"
700 +LOCK_FILE="/var/lock/subsys/$DAEMON"
701 +PID_FILE="/var/run/dmeventd.pid"
704 export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
707 - status -p "$PID_FILE" "$DMEVENTD_DAEMON"
711 - rh_status >/dev/null 2>&1
716 + local config="'log{command_names=0 prefix=\" \"}'"
717 # TODO do we want to separate out already active groups only?
718 - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null`
719 + VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config $config 2> /dev/null`
722 - action "Starting monitoring for VG $vg:" "$VGCHANGE" --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$?
723 + run_cmd "Starting monitoring for LVM VG $vg" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config $config $vg
733 + local config="'log{command_names=0 prefix=\" \"}'"
734 # TODO do we want to separate out already active groups only?
735 if test "$WARN" = "1"; then
736 echo "Not stopping monitoring, this is a dangerous operation. Please use force-stop to override."
739 - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null`
740 + VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config ${config} 2> /dev/null`
743 - action "Stopping monitoring for VG $vg:" "$VGCHANGE" --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$?
744 + run_cmd "Stopping monitoring for LVM VG $vg" $VGCHANGE --monitor n --ignoreskippedcluster --config $config $vg
752 # See how we were called.
755 - rh_status_q && exit 0
756 + status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 && exit 0
759 - [ "$rtrn" = 0 ] && touch "$LOCK_FILE"
761 + [ "$RETVAL" = 0 ] && touch "$LOCK_FILE"
765 - rh_status_q || exit 0
766 + status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 || exit 0
770 - [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE"
772 + [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE"
776 - rh_status_q || exit 0
777 + status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 || exit 0
778 test "$runlevel" = "0" && WARN=0
779 test "$runlevel" = "6" && WARN=0
782 - [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE"
784 + [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE"
796 + [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE"
799 + [ "$RETVAL" = 0 ] && touch "$LOCK_FILE"
805 - [ "$rtrn" = 0 ] && "$LVS" -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor
806 + status "$DMEVENTD_DAEMON"
808 + [ "$RETVAL" = 0 ] && $LVS -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor
812 - echo $"Usage: $0 {start|stop|restart|status|force-stop}"
813 + msg_usage "$0 {start|stop|restart|status|force-stop}"