X-Git-Url: https://git.tld-linux.org/?p=packages%2Flvm2.git;a=blobdiff_plain;f=lvm2-tld_init.patch;h=b34ec12ec59ac72c712f63d033feabcceb799b6e;hp=6c6c82d05fd3ddc8464c7cb1041d8a8d55c9981a;hb=20ad8b5da863c8db62e98ac5e2ff6659237cf428;hpb=ba8c629f1eca8e931865aad3a1a8ceaf18e95a7c diff --git a/lvm2-tld_init.patch b/lvm2-tld_init.patch index 6c6c82d..b34ec12 100644 --- a/lvm2-tld_init.patch +++ b/lvm2-tld_init.patch @@ -1,26 +1,40 @@ -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.02.132.orig/scripts/blk_availability_init_red_hat.in LVM2.2.02.132/scripts/blk_availability_init_red_hat.in +--- LVM2.2.02.132.orig/scripts/blk_availability_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000 ++++ LVM2.2.02.132/scripts/blk_availability_init_red_hat.in 2015-10-05 12:31:30.991042000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright (C) 2012 Red Hat, Inc. All rights reserved. # -@@ -43,16 +43,20 @@ +@@ -31,28 +31,26 @@ + + . /etc/init.d/functions + +-sbindir=@sbindir@ +-script=blkdeactivate +-options="-u -l wholevg" ++DAEMON="blkdeactivate" ++OPTIONS="-u -l wholevg" + + LOCK_FILE="/var/lock/subsys/blk-availability" + +- +-rtrn=1 +- case "$1" in start) touch $LOCK_FILE + exit 0 ;; - +- stop) - action "Stopping block device availability:" $sbindir/$script $options -+ run_cmd "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 ;; @@ -30,42 +44,84 @@ diff -dur LVM2.2.02.107.orig/scripts/blk_availability_init_red_hat.in LVM2.2.02. + 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.02.132.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.132/scripts/clvmd_init_red_hat.in +--- LVM2.2.02.132.orig/scripts/clvmd_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000 ++++ LVM2.2.02.132/scripts/clvmd_init_red_hat.in 2015-10-05 19:20:56.249042000 +0000 +@@ -18,15 +18,12 @@ + + . /etc/rc.d/init.d/functions + +-DAEMON=clvmd ++DAEMON="clvmd" + +-exec_prefix=@exec_prefix@ +-sbindir=@sbindir@ +- +-lvm_vgchange=${sbindir}/vgchange +-lvm_vgs=${sbindir}/vgs +-lvm_vgscan=${sbindir}/vgscan +-lvm_lvs=${sbindir}/lvs ++lvm_vgchange="/sbin/vgchange" ++lvm_vgs="/sbin/vgs" ++lvm_vgscan="/sbin/vgscan" ++lvm_lvs="/sbin/lvs" + + CLVMDOPTS="-T30" + +@@ -50,20 +47,11 @@ + ${lvm_lvs} --noheadings -o lv_name -S 'vg_clustered=1 && lv_active!=""' 2>/dev/null + } + +-rh_status() { +- status $DAEMON +-} +- +-rh_status_q() { +- rh_status >/dev/null 2>&1 +-} +- start() { - if ! rh_status_q; then +- if ! rh_status_q; then - echo -n "Starting $DAEMON: " ++ if ! status $DAEMON 1>/dev/null 2>&1; then + msg_starting "$DAEMON" $DAEMON $CLVMDOPTS || return $? - echo fi # Refresh local cache. -@@ -88,7 +87,7 @@ +@@ -82,74 +70,62 @@ + # unnecessary warnings. ${lvm_vgscan} > /dev/null 2>&1 - +- - action "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $? +- + run_cmd "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $? - touch $LOCK_FILE +- + return 0 + } -@@ -113,27 +112,23 @@ + wait_for_finish() + { + count=0 +- while [ "$count" -le "$CLVMD_STOP_TIMEOUT" ] && \ +- rh_status_q ]; do ++ while [ "$count" -le "$CLVMD_STOP_TIMEOUT" ] && status $DAEMON 1>/dev/null 2>&1 ; do + sleep 1 + count=$((count+1)) + done +- +- ! rh_status_q ++ ! status $DAEMON 1>/dev/null 2>&1 + } + + stop() + { +- rh_status_q || return 0 ++ status $DAEMON 1>/dev/null 2>&1 || return 0 [ -z "$LVM_VGS" ] && LVM_VGS="$(clustered_vgs)" if [ -n "$LVM_VGS" ]; then @@ -82,12 +138,13 @@ diff -dur LVM2.2.02.107.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.107/scripts # 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 - - if rh_status_q; then +- +- if rh_status_q; then - echo -n "$DAEMON failed to exit" - failure - echo ++ status $DAEMON 1>/dev/null 2>&1 && run_cmd "Waiting for $DAEMON to exit:" wait_for_finish ++ if status $DAEMON 1>/dev/null 2>&1; then + fail return 1 else @@ -96,18 +153,25 @@ diff -dur LVM2.2.02.107.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.107/scripts - echo + ok fi - +- rm -f $LOCK_FILE -@@ -143,7 +138,7 @@ +- + return 0 + } reload() { - rh_status_q || exit 7 +- rh_status_q || exit 7 - action "Reloading $DAEMON configuration: " $DAEMON -R || return $? ++ status $DAEMON 1>/dev/null 2>&1 || exit 7 + run_cmd "Reloading $DAEMON configuration: " $DAEMON -R || return $? } restart() { -@@ -154,7 +149,7 @@ + # if stop fails, restart will return the error and not attempt +- # another start. Even if start is protected by rh_status_q, ++ # another start. Even if start is protected by status call, + # that would avoid spawning another daemon, it would try to + # reactivate the VGs. # Try to get clvmd to restart itself. This will preserve # exclusive LV locks @@ -116,28 +180,406 @@ diff -dur LVM2.2.02.107.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.107/scripts # If that fails then do a normal stop & restart if [ $? != 0 ]; then -diff -dur LVM2.2.02.107.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.02.107/scripts/lvm2_monitoring_init_red_hat.in ---- LVM2.2.02.107.orig/scripts/lvm2_monitoring_init_red_hat.in 2014-06-23 14:07:38.000000000 +0000 -+++ LVM2.2.02.107/scripts/lvm2_monitoring_init_red_hat.in 2014-07-25 16:29:30.757000000 +0000 +@@ -166,49 +142,43 @@ + exit 4 + } + ++RETVAL=0 + # See how we were called. + case "$1" in + start) + start +- rtrn=$? ++ RETVAL=$? + ;; +- + stop) + stop +- rtrn=$? ++ RETVAL=$? + ;; +- + restart|force-reload) + restart +- rtrn=$? ++ RETVAL=$? + ;; +- + condrestart|try-restart) +- rh_status_q || exit 0 ++ status $DAEMON 1>/dev/null 2>&1 || exit 0 + restart +- rtrn=$? ++ RETVAL=$? + ;; +- + reload) + reload +- rtrn=$? ++ RETVAL=$? + ;; +- + status) +- rh_status +- rtrn=$? +- if [ $rtrn = 0 ]; then ++ status $DAEMON ++ RETVAL=$? ++ if [ $RETVAL = 0 ]; then + cvgs="$(clustered_vgs)" + echo Clustered Volume Groups: ${cvgs:-"(none)"} + clvs="$(clustered_active_lvs)" + echo Active clustered Logical Volumes: ${clvs:-"(none)"} + fi + ;; +- + *) +- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" +- rtrn=2 ++ msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" ++ RETVAL=2 + ;; + esac +- +-exit $rtrn ++exit $RETVAL +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 +--- LVM2.2.02.132.orig/scripts/lvm2_lvmetad_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000 ++++ LVM2.2.02.132/scripts/lvm2_lvmetad_init_red_hat.in 2015-10-06 06:06:01.799042000 +0000 +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # Copyright (C) 2012 Red Hat, Inc. All rights reserved. + # +@@ -33,80 +33,76 @@ + + . /etc/init.d/functions + +-DAEMON=lvmetad ++DAEMON="lvmetad" ++NAME="LVM metadata daemon" + +-exec_prefix=@exec_prefix@ +-sbindir=@sbindir@ +- +-LOCK_FILE="/var/lock/subsys/$DAEMON" ++LOCK_FILE="/var/lock/subsys/lvm2-lvmetad" + PID_FILE="@LVMETAD_PIDFILE@" + +-rh_status() { +- status -p $PID_FILE $DAEMON ++start() { ++ if [ -f $LOCK_FILE ]; then ++ msg_already_running $NAME ++ return ++ fi ++ msg_starting $NAME ++ daemon /sbin/$DAEMON /dev/null 2>&1 ++stop() { ++ if [ ! -f $LOCK_FILE ]; then ++ msg_not_running $NAME ++ return ++ fi ++ msg_stopping $NAME ++ killproc --pidfile $PID_FILE $DAEMON ++ rm -f $LOCK_FILE + } + +-start() +-{ +- ret=0 +- action "Starting LVM metadata daemon:" $DAEMON || ret=$? +- return $ret ++condrestart() { ++ if [ ! -f $LOCK_FILE ]; then ++ msg_not_running $NAME ++ RETVAL=$1 ++ return ++ fi ++ stop ++ start + } + +- +-stop() +-{ +- ret=0 +- action "Signaling LVM metadata daemon to exit:" killproc -p $PID_FILE $DAEMON -TERM || ret=$? +- return $ret ++reload() { ++ if [ ! -f $LOCK_FILE ]; then ++ msg_not_running $NAME ++ RETVAL=7 ++ return ++ fi ++ msg_reloading $NAME ++ killproc $DAEMON -HUP ++ RETVAL=$? + } + +-rtrn=1 +- ++RETVAL=0 + # See how we were called. + case "$1" in + start) +- rh_status_q && exit 0 + start +- rtrn=$? +- [ $rtrn = 0 ] && touch $LOCK_FILE + ;; +- +- stop|force-stop) +- rh_status_q || exit 0 ++ stop) + stop +- rtrn=$? +- [ $rtrn = 0 ] && rm -f $LOCK_FILE + ;; +- + restart) +- if stop +- then +- start +- fi +- rtrn=$? ++ stop ++ start + ;; +- + condrestart|try-restart) +- rh_status_q || exit 0 +- if stop +- then +- start +- fi +- rtrn=$? ++ condrestart 0 + ;; +- + status) +- rh_status +- rtrn=$? ++ status $DAEMON ++ exit $? + ;; +- + *) +- echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}" ++ msg_usage "$0 {start|stop|force-stop|restart|condrestart|try-restart|status}" + ;; + esac +- +-exit $rtrn ++exit $RETVAL +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 +--- LVM2.2.02.132.orig/scripts/lvm2_lvmpolld_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000 ++++ LVM2.2.02.132/scripts/lvm2_lvmpolld_init_red_hat.in 2015-10-06 06:07:04.889042000 +0000 +@@ -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,88 +27,84 @@ + # 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 + + . /etc/init.d/functions + +-DAEMON=lvmpolld ++DAEMON="lvmpolld" ++NAME="LVM poll daemon" + +-exec_prefix=@exec_prefix@ +-sbindir=@sbindir@ +- +-LOCK_FILE="/var/lock/subsys/$DAEMON" ++LOCK_FILE="/var/lock/subsys/lvm2-lvmpolld" + PID_FILE="@LVMPOLLD_PIDFILE@" + +-rh_status() { +- status -p $PID_FILE $DAEMON ++start() { ++ if [ -f $LOCK_FILE ]; then ++ msg_already_running $NAME ++ return ++ fi ++ msg_starting $NAME ++ daemon /sbin/$DAEMON /dev/null 2>&1 ++stop() { ++ if [ ! -f $LOCK_FILE ]; then ++ msg_not_running $NAME ++ return ++ fi ++ msg_stopping $NAME ++ killproc --pidfile $PID_FILE $DAEMON ++ rm -f $LOCK_FILE + } + +-start() +-{ +- ret=0 +- action "Starting LVM poll daemon:" $DAEMON || ret=$? +- return $ret ++condrestart() { ++ if [ ! -f $LOCK_FILE ]; then ++ msg_not_running $NAME ++ RETVAL=$1 ++ return ++ fi ++ stop ++ start + } + +- +-stop() +-{ +- ret=0 +- action "Signaling LVM poll daemon to exit:" killproc -p $PID_FILE $DAEMON -TERM || ret=$? +- return $ret ++reload() { ++ if [ ! -f $LOCK_FILE ]; then ++ msg_not_running $NAME ++ RETVAL=7 ++ return ++ fi ++ msg_reloading $NAME ++ killproc $DAEMON -HUP ++ RETVAL=$? + } + +-rtrn=1 +- ++RETVAL=0 + # See how we were called. + case "$1" in + start) +- rh_status_q && exit 0 + start +- rtrn=$? +- [ $rtrn = 0 ] && touch $LOCK_FILE + ;; +- +- stop|force-stop) +- rh_status_q || exit 0 ++ stop) + stop +- rtrn=$? +- [ $rtrn = 0 ] && rm -f $LOCK_FILE + ;; +- + restart) +- if stop +- then +- start +- fi +- rtrn=$? ++ stop ++ start + ;; +- + condrestart|try-restart) +- rh_status_q || exit 0 +- if stop +- then +- start +- fi +- rtrn=$? ++ condrestart 0 + ;; +- + status) +- rh_status +- rtrn=$? ++ status $DAEMON ++ exit $? + ;; +- + *) +- echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}" ++ msg_usage "$0 {start|stop|force-stop|restart|condrestart|try-restart|status}" + ;; + esac +- +-exit $rtrn ++exit $RETVAL +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 +--- LVM2.2.02.132.orig/scripts/lvm2_monitoring_init_red_hat.in 2015-09-22 15:00:59.000000000 +0000 ++++ LVM2.2.02.132/scripts/lvm2_monitoring_init_red_hat.in 2015-10-05 12:32:01.204042000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved. # -@@ -46,32 +46,29 @@ +@@ -31,15 +31,12 @@ + + . /etc/init.d/functions + +-DAEMON=lvm2-monitor +-DMEVENTD_DAEMON=dmeventd ++DAEMON="lvm2-monitor" ++DMEVENTD_DAEMON="dmeventd" + +-exec_prefix=@exec_prefix@ +-sbindir=@sbindir@ +- +-VGCHANGE=${sbindir}/vgchange +-VGS=${sbindir}/vgs +-LVS=${sbindir}/lvs ++VGCHANGE="/sbin/vgchange" ++VGS="/sbin/vgs" ++LVS="/sbin/lvs" + LOCK_FILE="/var/lock/subsys/$DAEMON" + PID_FILE="@DMEVENTD_PIDFILE@" +@@ -47,89 +44,69 @@ + 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 + 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 ++ run_cmd "Starting monitoring for LVM VG $vg" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config $config $vg done - - return $ret @@ -154,13 +596,78 @@ 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 ++ 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 ++ start + ;; +- + 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