aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch
blob: 5b55111dc6286606994e194acb63fb26979a18e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
From 916ea0c70fd063ab7b81f16fd917a75dc02edf4f Mon Sep 17 00:00:00 2001
From: Peter Kjellerstedt <pkj@axis.com>
Date: Fri, 17 Mar 2017 03:18:28 +0100
Subject: [PATCH] Avoid bashisms in init scripts

Upstream-Status: Inappropriate

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 scripts/blk_availability_init_red_hat.in      | 4 ++--
 scripts/clvmd_init_red_hat.in                 | 6 +++---
 scripts/cmirrord_init_red_hat.in              | 4 ++--
 scripts/lvm2_cluster_activation_red_hat.sh.in | 4 ++--
 scripts/lvm2_lvmetad_init_red_hat.in          | 4 ++--
 scripts/lvm2_lvmpolld_init_red_hat.in         | 4 ++--
 scripts/lvm2_monitoring_init_red_hat.in       | 4 ++--
 scripts/lvm2_monitoring_init_rhel4            | 4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)

Index: LVM2.2.02.177/scripts/blk_availability_init_red_hat.in
===================================================================
--- LVM2.2.02.177.orig/scripts/blk_availability_init_red_hat.in
+++ LVM2.2.02.177/scripts/blk_availability_init_red_hat.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved.
 #
@@ -51,6 +51,6 @@ case "$1" in
   status)
 	;;
   *)
-	echo $"Usage: $0 {start|stop|status}"
+	echo "Usage: $0 {start|stop|status}"
 	;;
 esac
Index: LVM2.2.02.177/scripts/clvmd_init_red_hat.in
===================================================================
--- LVM2.2.02.177.orig/scripts/clvmd_init_red_hat.in
+++ LVM2.2.02.177/scripts/clvmd_init_red_hat.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # clvmd - Clustered LVM Daemon init script
 #
@@ -161,7 +161,7 @@ restart() {
 	fi
 }
 
-[ "$EUID" != "0" ] && {
+[ "$(id -u)" != "0" ] && {
 	echo "clvmd init script can only be executed as root user"
 	exit 4
 }
@@ -206,7 +206,7 @@ case "$1" in
 	;;
 
   *)
-	echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+	echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
 	rtrn=2
 	;;
 esac
Index: LVM2.2.02.177/scripts/cmirrord_init_red_hat.in
===================================================================
--- LVM2.2.02.177.orig/scripts/cmirrord_init_red_hat.in
+++ LVM2.2.02.177/scripts/cmirrord_init_red_hat.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # chkconfig: - 22 78
 # description: Starts and stops cmirrord
@@ -103,7 +103,7 @@ case "$1" in
 		;;
 
 	*)
-		echo $"Usage: $0 {start|stop|restart|status}"
+		echo "Usage: $0 {start|stop|restart|status}"
 		;;
 esac
 
Index: LVM2.2.02.177/scripts/lvm2_cluster_activation_red_hat.sh.in
===================================================================
--- LVM2.2.02.177.orig/scripts/lvm2_cluster_activation_red_hat.sh.in
+++ LVM2.2.02.177/scripts/lvm2_cluster_activation_red_hat.sh.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 sbindir="@SBINDIR@"
 
@@ -54,7 +54,7 @@ case "$1" in
 	rtrn=$?
 	;;
   *)
-	echo $"Usage: $0 {activate|deactivate}"
+	echo "Usage: $0 {activate|deactivate}"
 	rtrn=3
 	;;
 esac
Index: LVM2.2.02.177/scripts/lvm2_lvmetad_init_red_hat.in
===================================================================
--- LVM2.2.02.177.orig/scripts/lvm2_lvmetad_init_red_hat.in
+++ LVM2.2.02.177/scripts/lvm2_lvmetad_init_red_hat.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved.
 #
@@ -103,7 +103,7 @@ case "$1" in
 	;;
 
   *)
-	echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+	echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
 	;;
 esac
 
Index: LVM2.2.02.177/scripts/lvm2_lvmpolld_init_red_hat.in
===================================================================
--- LVM2.2.02.177.orig/scripts/lvm2_lvmpolld_init_red_hat.in
+++ LVM2.2.02.177/scripts/lvm2_lvmpolld_init_red_hat.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Copyright (C) 2015 Red Hat, Inc. All rights reserved.
 #
@@ -105,7 +105,7 @@ case "$1" in
 	;;
 
   *)
-	echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+	echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
 	;;
 esac
 
Index: LVM2.2.02.177/scripts/lvm2_monitoring_init_red_hat.in
===================================================================
--- LVM2.2.02.177.orig/scripts/lvm2_monitoring_init_red_hat.in
+++ LVM2.2.02.177/scripts/lvm2_monitoring_init_red_hat.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
 #
@@ -127,7 +127,7 @@ case "$1" in
 	;;
 
   *)
-	echo $"Usage: $0 {start|stop|restart|status|force-stop}"
+	echo "Usage: $0 {start|stop|restart|status|force-stop}"
 	;;
 esac
 
Index: LVM2.2.02.177/scripts/lvm2_monitoring_init_rhel4
===================================================================
--- LVM2.2.02.177.orig/scripts/lvm2_monitoring_init_rhel4
+++ LVM2.2.02.177/scripts/lvm2_monitoring_init_rhel4
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Copyright (C) 2007 Red Hat, Inc. All rights reserved.
 #
@@ -93,7 +93,7 @@ case "$1" in
 	;;
 
   *)
-	echo $"Usage: $0 {start|stop|restart|status|force-stop}"
+	echo "Usage: $0 {start|stop|restart|status|force-stop}"
 	;;
 esac