]> TLD Linux GIT Repositories - packages/lvm2.git/blob - lvm2-tld_init.patch
- renamed
[packages/lvm2.git] / lvm2-tld_init.patch
1 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
2 --- LVM2.2.02.107.orig/scripts/blk_availability_init_red_hat.in 2014-06-23 14:07:38.000000000 +0000
3 +++ LVM2.2.02.107/scripts/blk_availability_init_red_hat.in      2014-07-25 16:24:42.989000000 +0000
4 @@ -1,4 +1,4 @@
5 -#!/bin/bash
6 +#!/bin/sh
7  #
8  # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
9  #
10 @@ -43,16 +43,20 @@
11  case "$1" in
12    start)
13         touch $LOCK_FILE
14 +       exit 0
15         ;;
16  
17    stop)
18 -       action "Stopping block device availability:" $sbindir/$script $options
19 +       run_cmd "Stopping block device availability:" $sbindir/$script $options
20         rm -f $LOCK_FILE
21 +       exit 0
22         ;;
23  
24    status)
25 +       exit 0
26         ;;
27    *)
28 -       echo $"Usage: $0 {start|stop|status}"
29 +       msg_usage "$0 {start|stop|status}"
30 +       exit 3
31         ;;
32  esac
33 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
34 --- LVM2.2.02.107.orig/scripts/blk_availability_systemd_red_hat.service.in      2014-06-23 14:07:38.000000000 +0000
35 +++ LVM2.2.02.107/scripts/blk_availability_systemd_red_hat.service.in   2014-07-25 16:24:42.992000000 +0000
36 @@ -6,7 +6,7 @@
37  
38  [Service]
39  Type=oneshot
40 -ExecStart=/usr/bin/true
41 +ExecStart=/bin/true
42  ExecStop=@sbindir@/blkdeactivate -u -l wholevg
43  RemainAfterExit=yes
44  
45 diff -dur LVM2.2.02.107.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.107/scripts/clvmd_init_red_hat.in
46 --- LVM2.2.02.107.orig/scripts/clvmd_init_red_hat.in    2014-06-23 14:07:38.000000000 +0000
47 +++ LVM2.2.02.107/scripts/clvmd_init_red_hat.in 2014-07-25 16:24:42.989000000 +0000
48 @@ -66,9 +66,8 @@
49  start()
50  {
51         if ! rh_status_q; then
52 -               echo -n "Starting $DAEMON: "
53 +               msg_starting "$DAEMON"
54                 $DAEMON $CLVMDOPTS || return $?
55 -               echo
56         fi
57  
58         # Refresh local cache.
59 @@ -88,7 +87,7 @@
60  
61         ${lvm_vgscan} > /dev/null 2>&1
62  
63 -       action "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $?
64 +       run_cmd "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $?
65  
66         touch $LOCK_FILE
67  
68 @@ -113,27 +112,23 @@
69  
70         [ -z "$LVM_VGS" ] && LVM_VGS="$(clustered_vgs)"
71         if [ -n "$LVM_VGS" ]; then
72 -               action "Deactivating clustered VG(s):" ${lvm_vgchange} -anl $LVM_VGS || return $?
73 +               run_cmd "Deactivating clustered VG(s):" ${lvm_vgchange} -anl $LVM_VGS || return $?
74         fi
75  
76 -       action "Signaling $DAEMON to exit" kill -TERM $(pidofproc $DAEMON) || return $?
77 +       run_cmd "Signaling $DAEMON to exit" kill -TERM $(pidofproc $DAEMON) || return $?
78  
79         # wait half second before we start the waiting loop or we will show
80         # the loop more time than really necessary
81         usleep 500000
82  
83         # clvmd could take some time to stop
84 -       rh_status_q && action "Waiting for $DAEMON to exit:" wait_for_finish
85 +       rh_status_q && run_cmd "Waiting for $DAEMON to exit:" wait_for_finish
86  
87         if rh_status_q; then
88 -               echo -n "$DAEMON failed to exit"
89 -               failure
90 -               echo
91 +               fail
92                 return 1
93         else
94 -               echo -n "$DAEMON terminated"
95 -               success
96 -               echo
97 +               ok
98         fi
99  
100         rm -f $LOCK_FILE
101 @@ -143,7 +138,7 @@
102  
103  reload() {
104         rh_status_q || exit 7
105 -       action "Reloading $DAEMON configuration: " $DAEMON -R || return $?
106 +       run_cmd "Reloading $DAEMON configuration: " $DAEMON -R || return $?
107  }
108  
109  restart() {
110 @@ -154,7 +149,7 @@
111  
112         # Try to get clvmd to restart itself. This will preserve 
113         # exclusive LV locks
114 -       action "Restarting $DAEMON: " $DAEMON -S
115 +       run_cmd "Restarting $DAEMON: " $DAEMON -S
116  
117         # If that fails then do a normal stop & restart
118         if  [ $? != 0 ]; then
119 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
120 --- LVM2.2.02.107.orig/scripts/lvm2_monitoring_init_red_hat.in  2014-06-23 14:07:38.000000000 +0000
121 +++ LVM2.2.02.107/scripts/lvm2_monitoring_init_red_hat.in       2014-07-25 16:29:30.757000000 +0000
122 @@ -1,4 +1,4 @@
123 -#!/bin/bash
124 +#!/bin/sh
125  #
126  # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
127  #
128 @@ -46,32 +46,29 @@
129  
130  start()
131  {
132 -       ret=0
133 +       local config="'log{command_names=0 prefix=\"  \"}'"
134         # TODO do we want to separate out already active groups only?
135 -       VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' 2> /dev/null`
136 +       VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config $config 2> /dev/null`
137         for vg in $VGSLIST
138         do
139 -           action "Starting monitoring for VG $vg:" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' $vg || ret=$?
140 +           run_cmd "Starting monitoring for VG $vg" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config $config $vg
141         done
142 -
143 -       return $ret
144  }
145  
146  
147  stop()
148  {
149 -       ret=0
150 +       local config="'log{command_names=0 prefix=\"  \"}'"
151         # TODO do we want to separate out already active groups only?
152         if test "$WARN" = "1"; then
153            echo "Not stopping monitoring, this is a dangerous operation. Please use force-stop to override."
154            return 1
155         fi
156 -       VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' 2> /dev/null`
157 +       VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config ${config} 2> /dev/null`
158         for vg in $VGSLIST
159         do
160 -           action "Stopping monitoring for VG $vg:" $VGCHANGE --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' $vg || ret=$?
161 +           run_cmd "Stopping monitoring for VG $vg" $VGCHANGE --monitor n --ignoreskippedcluster --config $config $vg
162         done
163 -       return $ret
164  }
165  
166  rtrn=1