1 diff -urp LVM2.2.03.00.orig/scripts/blk_availability_init_red_hat.in LVM2.2.03.00/scripts/blk_availability_init_red_hat.in
2 --- LVM2.2.03.00.orig/scripts/blk_availability_init_red_hat.in 2018-10-21 14:21:38.112416609 +0000
3 +++ LVM2.2.03.00/scripts/blk_availability_init_red_hat.in 2018-10-21 14:21:53.152416609 +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.03.00.orig/scripts/cmirrord_init_red_hat.in LVM2.2.03.00/scripts/cmirrord_init_red_hat.in
48 --- LVM2.2.03.00.orig/scripts/cmirrord_init_red_hat.in 2018-10-21 14:21:38.112416609 +0000
49 +++ LVM2.2.03.00/scripts/cmirrord_init_red_hat.in 2018-10-21 14:25:55.744416609 +0000
53 # description: Starts and stops cmirrord
54 -# pidfile: @CMIRRORD_PIDFILE@
55 +# pidfile: /var/run/cmirrord.pid
57 # For Red-Hat-based distributions such as Fedora, RHEL, CentOS.
61 . /etc/init.d/functions
66 -usrsbindir="@USRSBINDIR@"
68 -LOCK_FILE="@DEFAULT_SYS_LOCK_DIR@/subsys/$DAEMON"
69 +LOCK_FILE="/var/lock/subsys/$DAEMON"
74 - if ! pidof "$DAEMON" > /dev/null
76 - echo -n "Starting $DAEMON: "
77 - daemon "$usrsbindir/$DAEMON"
83 + if [ -f $LOCK_FILE ]; then
84 + msg_already_running "$DAEMON"
87 + msg_starting "$DAEMON"
88 + daemon /sbin/$DAEMON </dev/null
90 + [ $RETVAL -eq 0 ] && touch "$LOCK_FILE"
95 - echo -n "Stopping $DAEMON:"
96 - killproc "$DAEMON" -TERM
107 - while [ "$count" -le 10 -a -n "`pidof $DAEMON`" ]
110 - count=$((count + 1))
113 - if [ "$(pidof "$DAEMON")" ]
118 + if [ ! -f $LOCK_FILE ]; then
119 + msg_not_running "$DAEMON"
122 + msg_stopping "$DAEMON"
123 + killproc --pidfile "$PID_FILE" "$DAEMON"
135 # See how we were called.
140 - [ "$rtrn" = 0 ] && touch "$LOCK_FILE"
146 - [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE"
163 - if [ "$rtrn" -eq 0 ]; then
164 - echo "cmirror is running."
171 - echo $"Usage: $0 {start|stop|restart|status}"
172 + msg_usage "$0 {start|stop|restart|status}"
178 diff -urp LVM2.2.03.00.orig/scripts/lvm2_lvmpolld_init_red_hat.in LVM2.2.03.00/scripts/lvm2_lvmpolld_init_red_hat.in
179 --- LVM2.2.03.00.orig/scripts/lvm2_lvmpolld_init_red_hat.in 2018-10-21 14:21:38.112416609 +0000
180 +++ LVM2.2.03.00/scripts/lvm2_lvmpolld_init_red_hat.in 2018-10-21 14:25:59.004416609 +0000
185 -# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
186 +# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
188 # This copyrighted material is made available to anyone wishing to use,
189 # modify, copy, or redistribute it subject to the terms and conditions
191 # Default-Start: 1 2 3 4 5
193 # Short-Description: A daemon that is responsible for monitoring in-progress
194 -# and possibly longer term operations on logical volumes.
195 -# It helps to reduce the number of spawned processes if same
196 +# and possibly longer term operations on logical volumes.
197 +# It helps to reduce the number of spawned processes if same
198 # logical volume is requested to get monitored multiple times.
199 # Also avoids unsolicited termination due to external factors.
202 . /etc/init.d/functions
206 +NAME="LVM poll daemon"
210 -LOCK_FILE="@DEFAULT_LOCK_DIR@/subsys/$DAEMON"
211 -PID_FILE="@LVMPOLLD_PIDFILE@"
214 - status -p "$PID_FILE" "$DAEMON"
218 - rh_status >/dev/null 2>&1
220 +LOCK_FILE="/var/lock/subsys/lvm2-lvmpolld"
221 +PID_FILE="/var/run/lvmpolld.pid"
226 - action "Starting LVM poll daemon:" "$sbindir/$DAEMON" || ret=$?
228 + if [ -f $LOCK_FILE ]; then
229 + msg_already_running "$NAME"
232 + msg_starting "$NAME"
233 + daemon "/sbin/$DAEMON" </dev/null
235 + [ "$RETVAL" -eq 0 ] && touch "$LOCK_FILE"
241 - action "Signaling LVM poll daemon to exit:" killproc -p "$PID_FILE" "$DAEMON" -TERM || ret=$?
243 + if [ ! -f "$LOCK_FILE" ]; then
244 + msg_not_running "$NAME"
247 + msg_stopping "$NAME"
248 + killproc --pidfile "$PID_FILE" "$DAEMON"
253 + if [ ! -f "$LOCK_FILE" ]; then
254 + msg_not_running "$NAME"
264 + if [ ! -f "$LOCK_FILE" ]; then
265 + msg_not_running "$NAME"
269 + msg_reloading "$NAME"
270 + killproc "$DAEMON" -HUP
275 # See how we were called.
278 - rh_status_q && exit 0
281 - [ $rtrn = 0 ] && touch "$LOCK_FILE"
285 - rh_status_q || exit 0
289 - [ $rtrn = 0 ] && rm -f "$LOCK_FILE"
302 condrestart|try-restart)
303 - rh_status_q || exit 0
320 - echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
321 + msg_usage "$0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
327 diff -urp LVM2.2.03.00.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.03.00/scripts/lvm2_monitoring_init_red_hat.in
328 --- LVM2.2.03.00.orig/scripts/lvm2_monitoring_init_red_hat.in 2018-10-21 14:21:38.112416609 +0000
329 +++ LVM2.2.03.00/scripts/lvm2_monitoring_init_red_hat.in 2018-10-21 14:25:59.004416609 +0000
334 # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
338 . /etc/init.d/functions
341 -DMEVENTD_DAEMON=dmeventd
342 +DAEMON="lvm2-monitor"
343 +DMEVENTD_DAEMON="dmeventd"
346 +VGCHANGE="/sbin/vgchange"
350 -VGCHANGE="$sbindir/vgchange"
354 -LOCK_FILE="@DEFAULT_SYS_LOCK_DIR@/subsys/$DAEMON"
355 -PID_FILE="@DMEVENTD_PIDFILE@"
356 +LOCK_FILE="/var/lock/subsys/$DAEMON"
357 +PID_FILE="/var/run/dmeventd.pid"
360 export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
363 - status -p "$PID_FILE" "$DMEVENTD_DAEMON"
367 - rh_status >/dev/null 2>&1
372 + local config="'log{command_names=0 prefix=\" \"}'"
373 # TODO do we want to separate out already active groups only?
374 - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null`
375 + VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config $config 2> /dev/null`
378 - action "Starting monitoring for VG $vg:" "$VGCHANGE" --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$?
379 + run_cmd "Starting monitoring for LVM VG $vg" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config $config $vg
389 + local config="'log{command_names=0 prefix=\" \"}'"
390 # TODO do we want to separate out already active groups only?
391 if test "$WARN" = "1"; then
392 echo "Not stopping monitoring, this is a dangerous operation. Please use force-stop to override."
395 - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null`
396 + VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config ${config} 2> /dev/null`
399 - action "Stopping monitoring for VG $vg:" "$VGCHANGE" --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$?
400 + run_cmd "Stopping monitoring for LVM VG $vg" $VGCHANGE --monitor n --ignoreskippedcluster --config $config $vg
408 # See how we were called.
411 - rh_status_q && exit 0
412 + status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 && exit 0
415 - [ "$rtrn" = 0 ] && touch "$LOCK_FILE"
417 + [ "$RETVAL" = 0 ] && touch "$LOCK_FILE"
421 - rh_status_q || exit 0
422 + status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 || exit 0
426 - [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE"
428 + [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE"
432 - rh_status_q || exit 0
433 + status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 || exit 0
434 test "$runlevel" = "0" && WARN=0
435 test "$runlevel" = "6" && WARN=0
438 - [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE"
440 + [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE"
452 + [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE"
455 + [ "$RETVAL" = 0 ] && touch "$LOCK_FILE"
461 - [ "$rtrn" = 0 ] && "$LVS" -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor
462 + status "$DMEVENTD_DAEMON"
464 + [ "$RETVAL" = 0 ] && $LVS -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor
468 - echo $"Usage: $0 {start|stop|restart|status|force-stop}"
469 + msg_usage "$0 {start|stop|restart|status|force-stop}"