X-Git-Url: https://git.tld-linux.org/?p=packages%2Flvm2.git;a=blobdiff_plain;f=lvm2-tld_init.patch;h=83b42eb1e8a9728ad8ec65e39c2843f254f09f81;hp=6c6c82d05fd3ddc8464c7cb1041d8a8d55c9981a;hb=fdec89449c51ab3141aab0dc9a49bf2326ec355e;hpb=ba8c629f1eca8e931865aad3a1a8ceaf18e95a7c diff --git a/lvm2-tld_init.patch b/lvm2-tld_init.patch index 6c6c82d..83b42eb 100644 --- a/lvm2-tld_init.patch +++ b/lvm2-tld_init.patch @@ -1,143 +1,382 @@ -diff -dur LVM2.2.02.107.orig/scripts/blk_availability_init_red_hat.in LVM2.2.02.107/scripts/blk_availability_init_red_hat.in ---- LVM2.2.02.107.orig/scripts/blk_availability_init_red_hat.in 2014-06-23 14:07:38.000000000 +0000 -+++ LVM2.2.02.107/scripts/blk_availability_init_red_hat.in 2014-07-25 16:24:42.989000000 +0000 +diff -ur LVM2.2.03.02.orig/scripts/blk_availability_init_red_hat.in LVM2.2.03.02/scripts/blk_availability_init_red_hat.in +--- LVM2.2.03.02.orig/scripts/blk_availability_init_red_hat.in 2019-03-22 17:01:45.758000000 +0100 ++++ LVM2.2.03.02/scripts/blk_availability_init_red_hat.in 2019-03-22 17:01:58.006000000 +0100 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # - # Copyright (C) 2012 Red Hat, Inc. All rights reserved. + # Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved. # -@@ -43,16 +43,20 @@ +@@ -31,26 +31,29 @@ + + . /etc/init.d/functions + +-script=blkdeactivate ++DAEMON="blkdeactivate" ++OPTIONS="-u -l wholevg -m disablequeueing" + +-sbindir=@SBINDIR@ +-options="-u -l wholevg -m disablequeueing -r wait" +- +-LOCK_FILE="@DEFAULT_LOCK_DIR@/subsys/blk-availability" ++LOCK_FILE="/var/lock/subsys/blk-availability" + case "$1" in start) - touch $LOCK_FILE + touch "$LOCK_FILE" + exit 0 ;; stop) -- action "Stopping block device availability:" $sbindir/$script $options -+ run_cmd "Stopping block device availability:" $sbindir/$script $options - rm -f $LOCK_FILE +- action "Stopping block device availability:" "$sbindir/$script" $options ++ run_cmd "Stopping block device availability:" "/sbin/$DAEMON" $OPTIONS + rm -f "$LOCK_FILE" + exit 0 ;; status) + exit 0 ;; ++ *) - echo $"Usage: $0 {start|stop|status}" + msg_usage "$0 {start|stop|status}" + exit 3 ;; esac -diff -dur LVM2.2.02.107.orig/scripts/blk_availability_systemd_red_hat.service.in LVM2.2.02.107/scripts/blk_availability_systemd_red_hat.service.in ---- LVM2.2.02.107.orig/scripts/blk_availability_systemd_red_hat.service.in 2014-06-23 14:07:38.000000000 +0000 -+++ LVM2.2.02.107/scripts/blk_availability_systemd_red_hat.service.in 2014-07-25 16:24:42.992000000 +0000 -@@ -6,7 +6,7 @@ - - [Service] - Type=oneshot --ExecStart=/usr/bin/true -+ExecStart=/bin/true - ExecStop=@sbindir@/blkdeactivate -u -l wholevg - RemainAfterExit=yes - -diff -dur LVM2.2.02.107.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.107/scripts/clvmd_init_red_hat.in ---- LVM2.2.02.107.orig/scripts/clvmd_init_red_hat.in 2014-06-23 14:07:38.000000000 +0000 -+++ LVM2.2.02.107/scripts/clvmd_init_red_hat.in 2014-07-25 16:24:42.989000000 +0000 -@@ -66,9 +66,8 @@ +diff -ur LVM2.2.03.02.orig/scripts/cmirrord_init_red_hat.in LVM2.2.03.02/scripts/cmirrord_init_red_hat.in +--- LVM2.2.03.02.orig/scripts/cmirrord_init_red_hat.in 2019-03-22 17:01:45.758000000 +0100 ++++ LVM2.2.03.02/scripts/cmirrord_init_red_hat.in 2019-03-22 17:01:58.006000000 +0100 +@@ -2,7 +2,7 @@ + # + # chkconfig: - 22 78 + # description: Starts and stops cmirrord +-# pidfile: @CMIRRORD_PIDFILE@ ++# pidfile: /var/run/cmirrord.pid + # + # For Red-Hat-based distributions such as Fedora, RHEL, CentOS. + # +@@ -16,95 +16,57 @@ + + . /etc/init.d/functions + +-DAEMON=cmirrord ++DAEMON="cmirrord" + +-usrsbindir="@USRSBINDIR@" +- +-LOCK_FILE="@DEFAULT_SYS_LOCK_DIR@/subsys/$DAEMON" ++LOCK_FILE="/var/lock/subsys/$DAEMON" + start() { - if ! rh_status_q; then +- rtrn=0 +- if ! pidof "$DAEMON" > /dev/null +- then - echo -n "Starting $DAEMON: " -+ msg_starting "$DAEMON" - $DAEMON $CLVMDOPTS || return $? +- daemon "$usrsbindir/$DAEMON" +- rtrn=$? - echo - fi +- fi +- +- return $rtrn ++ if [ -f $LOCK_FILE ]; then ++ msg_already_running "$DAEMON" ++ return ++ fi ++ msg_starting "$DAEMON" ++ daemon /sbin/$DAEMON /dev/null 2>&1 +-cmirror_status() +-{ +- status "$DAEMON" +-} +- +-rtrn=1 +- ++RETVAL=0 + # See how we were called. + case "$1" in + start) + start +- rtrn=$? +- [ "$rtrn" = 0 ] && touch "$LOCK_FILE" + ;; -- action "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $? -+ run_cmd "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $? + stop) + stop +- rtrn=$? +- [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE" + ;; - touch $LOCK_FILE + restart) +- if stop +- then +- wait_for_finish +- start +- fi +- rtrn=$? ++ stop ++ start + ;; -@@ -113,27 +112,23 @@ + status) +- cmirror_status +- rtrn=$? +- if [ "$rtrn" -eq 0 ]; then +- echo "cmirror is running." +- fi ++ status $DAEMON ++ exit $? + ;; - [ -z "$LVM_VGS" ] && LVM_VGS="$(clustered_vgs)" - if [ -n "$LVM_VGS" ]; then -- action "Deactivating clustered VG(s):" ${lvm_vgchange} -anl $LVM_VGS || return $? -+ run_cmd "Deactivating clustered VG(s):" ${lvm_vgchange} -anl $LVM_VGS || return $? - fi + *) +- echo $"Usage: $0 {start|stop|restart|status}" ++ msg_usage "$0 {start|stop|restart|status}" + ;; + esac -- action "Signaling $DAEMON to exit" kill -TERM $(pidofproc $DAEMON) || return $? -+ run_cmd "Signaling $DAEMON to exit" kill -TERM $(pidofproc $DAEMON) || return $? +-exit $rtrn ++exit $RETVAL +diff -ur LVM2.2.03.02.orig/scripts/lvm2_lvmpolld_init_red_hat.in LVM2.2.03.02/scripts/lvm2_lvmpolld_init_red_hat.in +--- LVM2.2.03.02.orig/scripts/lvm2_lvmpolld_init_red_hat.in 2019-03-22 17:01:45.758000000 +0100 ++++ LVM2.2.03.02/scripts/lvm2_lvmpolld_init_red_hat.in 2019-03-22 17:01:58.006000000 +0100 +@@ -1,6 +1,6 @@ +-#!/bin/bash ++#!/bin/sh + # +-# Copyright (C) 2015 Red Hat, Inc. All rights reserved. ++# Copyright (C) 2012 Red Hat, Inc. All rights reserved. + # + # This copyrighted material is made available to anyone wishing to use, + # modify, copy, or redistribute it subject to the terms and conditions +@@ -27,86 +27,92 @@ + # Default-Start: 1 2 3 4 5 + # Default-Stop: 0 6 + # Short-Description: A daemon that is responsible for monitoring in-progress +-# and possibly longer term operations on logical volumes. +-# It helps to reduce the number of spawned processes if same ++# and possibly longer term operations on logical volumes. ++# It helps to reduce the number of spawned processes if same + # logical volume is requested to get monitored multiple times. + # Also avoids unsolicited termination due to external factors. + ### END INIT INFO - # wait half second before we start the waiting loop or we will show - # the loop more time than really necessary - usleep 500000 + . /etc/init.d/functions - # clvmd could take some time to stop -- rh_status_q && action "Waiting for $DAEMON to exit:" wait_for_finish -+ rh_status_q && run_cmd "Waiting for $DAEMON to exit:" wait_for_finish +-DAEMON=lvmpolld ++DAEMON="lvmpolld" ++NAME="LVM poll daemon" - if rh_status_q; then -- echo -n "$DAEMON failed to exit" -- failure -- echo -+ fail - return 1 - else -- echo -n "$DAEMON terminated" -- success -- echo -+ ok - fi +-sbindir="@SBINDIR@" +- +-LOCK_FILE="@DEFAULT_LOCK_DIR@/subsys/$DAEMON" +-PID_FILE="@LVMPOLLD_PIDFILE@" +- +-rh_status() { +- status -p "$PID_FILE" "$DAEMON" +-} +- +-rh_status_q() { +- rh_status >/dev/null 2>&1 +-} ++LOCK_FILE="/var/lock/subsys/lvm2-lvmpolld" ++PID_FILE="/var/run/lvmpolld.pid" - rm -f $LOCK_FILE -@@ -143,7 +138,7 @@ + start() + { +- ret=0 +- action "Starting LVM poll daemon:" "$sbindir/$DAEMON" || ret=$? +- return $ret ++ if [ -f $LOCK_FILE ]; then ++ msg_already_running "$NAME" ++ return ++ fi ++ msg_starting "$NAME" ++ daemon "/sbin/$DAEMON" /dev/null 2>&1 +-} start() { - ret=0 + local config="'log{command_names=0 prefix=\" \"}'" # TODO do we want to separate out already active groups only? - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null` -+ VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config $config 2> /dev/null` ++ VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config $config 2> /dev/null` for vg in $VGSLIST do -- action "Starting monitoring for VG $vg:" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$? -+ run_cmd "Starting monitoring for VG $vg" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config $config $vg +- action "Starting monitoring for VG $vg:" "$VGCHANGE" --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$? ++ run_cmd "Starting monitoring for LVM VG $vg" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config $config $vg done - - return $ret @@ -154,13 +393,82 @@ diff -dur LVM2.2.02.107.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.02.1 return 1 fi - VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' 2> /dev/null` -+ VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config ${config} 2> /dev/null` ++ VGSLIST=`eval $VGS --noheadings -o name --ignoreskippedcluster --config ${config} 2> /dev/null` for vg in $VGSLIST do -- action "Stopping monitoring for VG $vg:" $VGCHANGE --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$? -+ run_cmd "Stopping monitoring for VG $vg" $VGCHANGE --monitor n --ignoreskippedcluster --config $config $vg +- action "Stopping monitoring for VG $vg:" "$VGCHANGE" --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix=" "}' $vg || ret=$? ++ run_cmd "Stopping monitoring for LVM VG $vg" $VGCHANGE --monitor n --ignoreskippedcluster --config $config $vg done - return $ret } - rtrn=1 +-rtrn=1 +- ++RETVAL=0 + # See how we were called. + case "$1" in + start) +- rh_status_q && exit 0 ++ status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 && exit 0 + start +- rtrn=$? +- [ "$rtrn" = 0 ] && touch "$LOCK_FILE" ++ RETVAL=$? ++ [ "$RETVAL" = 0 ] && touch "$LOCK_FILE" + ;; + + force-stop) +- rh_status_q || exit 0 ++ status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 || exit 0 + WARN=0 + stop +- rtrn=$? +- [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE" ++ RETVAL=$? ++ [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE" + ;; + + stop) +- rh_status_q || exit 0 ++ status "$DMEVENTD_DAEMON" 1>/dev/null 2>&1 || exit 0 + test "$runlevel" = "0" && WARN=0 + test "$runlevel" = "6" && WARN=0 + stop +- rtrn=$? +- [ "$rtrn" = 0 ] && rm -f "$LOCK_FILE" ++ RETVAL=$? ++ [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE" + ;; + + restart) + WARN=0 +- if stop +- then +- start +- fi +- rtrn=$? ++ stop ++ RETVAL=$? ++ [ "$RETVAL" = 0 ] && rm -f "$LOCK_FILE" ++ start ++ RETVAL=$? ++ [ "$RETVAL" = 0 ] && touch "$LOCK_FILE" + ;; + + status) +- rh_status +- rtrn=$? +- [ "$rtrn" = 0 ] && "$LVS" -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor ++ status "$DMEVENTD_DAEMON" ++ RETVAL=$? ++ [ "$RETVAL" = 0 ] && $LVS -S 'seg_monitor=monitored' -o lv_full_name,seg_monitor + ;; + + *) +- echo $"Usage: $0 {start|stop|restart|status|force-stop}" ++ msg_usage "$0 {start|stop|restart|status|force-stop}" + ;; + esac + +-exit $rtrn ++exit $RETVAL