]>
Commit | Line | Data |
---|---|---|
442f6557 ER |
1 | --- EMCpower-5.0.0/PowerPath.rhel 2007-02-07 10:06:21.000000000 +0200 |
2 | +++ EMCpower-5.0.0/PowerPath 2007-05-29 15:39:50.764904063 +0300 | |
69070f82 ER |
3 | @@ -1,5 +1,6 @@ |
4 | #!/bin/sh | |
5 | # | |
fae5e5ed | 6 | +# chkconfig: 2345 02 98 |
69070f82 ER |
7 | # description: Loads and configures the EMC PowerPath drivers. |
8 | # | |
9 | # ################################################################### | |
10 | @@ -15,6 +16,9 @@ | |
bd5b695b ER |
11 | |
12 | # @(#) $Header$ | |
13 | ||
14 | +# Source function library. | |
15 | +. /etc/rc.d/init.d/functions | |
16 | + | |
17 | ||
18 | # Functions to preserve exceptional command status return values | |
19 | ||
69070f82 | 20 | @@ -39,10 +43,10 @@ |
bd5b695b ER |
21 | then |
22 | case "$rc_script_stat" in | |
23 | 0) | |
24 | - echo "`eval_gettext \" done\"`" | |
442f6557 | 25 | + ok |
bd5b695b ER |
26 | ;; |
27 | *) | |
28 | - echo "`eval_gettext \" failed\"`" | |
442f6557 | 29 | + fail |
bd5b695b ER |
30 | ;; |
31 | esac | |
32 | fi | |
69070f82 | 33 | @@ -68,32 +72,13 @@ |
442f6557 ER |
34 | # @(#) $Header$ |
35 | ||
36 | PATH=/usr/bin/:/bin:/sbin:/usr/sbin | |
37 | -PPBASE=/etc/opt/emcpower/EMCpower.LINUX-5.0.0 | |
947c1f7e | 38 | |
b954ffc3 ER |
39 | # the following are the internationalization specific lines |
40 | - | |
41 | -if [ ! -x /usr/bin/gettext ]; then | |
42 | -gettext() | |
43 | -{ | |
44 | - echo $* | |
45 | -} | |
46 | -eval_gettext() | |
47 | -{ | |
48 | - eval "echo $*" | |
49 | -} | |
50 | - | |
51 | -else | |
52 | -. gettext.sh | |
53 | TEXTDOMAIN=PowerPath | |
54 | export TEXTDOMAIN | |
55 | -TEXTDOMAINDIR=$PPBASE/i18n/catalog | |
56 | - | |
57 | -export TEXTDOMAINDIR | |
58 | export RPM_INSTALL_PREFIX | |
59 | -fi | |
60 | # end of internationalization | |
61 | ||
62 | - | |
63 | pp_stop_lvm() | |
64 | { | |
65 | if test -x /sbin/vgchange -a -x /sbin/vgscan ; then | |
69070f82 | 66 | @@ -106,19 +91,19 @@ |
bd5b695b ER |
67 | err_stop=`/sbin/vgchange -a n $i 2>&1 | grep "open logical volume"` |
68 | if [ "$err_stop" != "" ]; then | |
69 | if [ "$open_vol" = "" ]; then | |
70 | - echo "`eval_gettext \"Following LVM volume groups are in use:\"`" | |
71 | + nls "Following LVM volume groups are in use:" | |
72 | open_vol=$err_stop | |
73 | fi | |
74 | var1=$i | |
75 | var2=`echo $pv` | |
76 | - echo "`eval_gettext \" Volume Group: \\$var1 (\\$var2)\"`" | |
77 | + echo "`nls " Volume Group: \\$var1 (\\$var2)"`" | |
78 | fi | |
79 | fi | |
80 | done | |
81 | fi | |
82 | if [ "$open_vol" != "" ]; then | |
83 | - echo "`eval_gettext \"These open logical volume devices use LUNs from Powerpath managed devices,\"`" | |
84 | - echo "`eval_gettext \"Please re-issue the command after closing these volumes.\"`" | |
85 | + nls "These open logical volume devices use LUNs from Powerpath managed devices," | |
86 | + nls "Please re-issue the command after closing these volumes." | |
87 | return 1 | |
88 | fi | |
89 | return 0 | |
69070f82 | 90 | @@ -154,9 +139,9 @@ |
bd5b695b ER |
91 | rc_check |
92 | ||
93 | if rc_status ; then | |
94 | - echo -e "`eval_gettext \"\nSuccessfully started 32-bit emulation library\"`" | |
95 | + nls "\nSuccessfully started 32-bit emulation library" | |
96 | else | |
97 | - echo -e "`eval_gettext \"\nError in starting 32-bit emulation library\"`" | |
98 | + nls "\nError in starting 32-bit emulation library" | |
99 | fi | |
100 | } | |
101 | ||
69070f82 | 102 | @@ -166,7 +151,7 @@ |
8060c842 ER |
103 | { |
104 | if [ -f /etc/emcp_devicesDB.dat ]; then | |
105 | if [ -f /etc/emcp_devicesDB.idx ]; then | |
106 | - /etc/opt/emcpower/emcpmgr map -p > /dev/null 2>&1 | |
d38200fa | 107 | + /sbin/emcpmgr map -p > /dev/null 2>&1 |
8060c842 ER |
108 | rc_check |
109 | fi | |
110 | fi | |
69070f82 | 111 | @@ -206,9 +191,9 @@ |
8060c842 ER |
112 | |
113 | /sbin/powermt load > /dev/null 2>&1 | |
114 | rc_check | |
115 | - /etc/opt/emcpower/emcpmgr map > /dev/null 2>&1 | |
d38200fa | 116 | + /sbin/emcpmgr map > /dev/null 2>&1 |
8060c842 ER |
117 | rc_check |
118 | - /etc/opt/emcpower/powercf -C > /dev/null 2>&1 | |
d38200fa | 119 | + /sbin/powercf -C > /dev/null 2>&1 |
8060c842 ER |
120 | /sbin/powermt save > /dev/null 2>&1 |
121 | rc_check | |
122 | /sbin/powermt register > /dev/null 2>&1 | |
69070f82 | 123 | @@ -224,15 +209,15 @@ |
947c1f7e | 124 | { |
bd5b695b ER |
125 | ps -C naviagent >> /dev/null |
126 | if [ $? -eq 0 ]; then | |
127 | - echo "`eval_gettext \"Navisphere agent is running.\"`" | |
128 | - echo "`eval_gettext \"Please stop the agent and then re-issue \\$script_name stop.\"`" | |
129 | + nls "Navisphere agent is running." | |
130 | + eval echo "$(nls \"Please stop the agent and then re-issue \\$script_name stop.\")" | |
131 | return 1 | |
132 | fi | |
133 | ||
134 | ps -C powermt >> /dev/null | |
135 | if [ $? -eq 0 ]; then | |
136 | - echo "`eval_gettext \"The powermt command is running.\"`" | |
137 | - echo "`eval_gettext \"Please stop powermt and then re-issue \\$script_name stop.\"`" | |
138 | + nls "The powermt command is running." | |
139 | + echo "`eval nls \"Please stop powermt and then re-issue \\$script_name stop.\"`" | |
140 | return 1 | |
141 | fi | |
947c1f7e | 142 | |
69070f82 | 143 | @@ -240,8 +225,8 @@ |
947c1f7e ER |
144 | if [ $? -eq 0 ]; then |
145 | echo "$mig_info" | grep 'No migrations found' > /dev/null | |
146 | if test $? -ne 0 ; then | |
147 | - echo "`eval_gettext \"PowerPath migrations are present.\"`" | |
148 | - echo "`eval_gettext \"Please cleanup the migrations and then re-issue \\$script_name stop.\"`" | |
149 | + nls "PowerPath migrations are present." | |
442f6557 | 150 | + eval echo "$(nls "Please cleanup the migrations and then re-issue \\$script_name stop.")" |
947c1f7e ER |
151 | return 1 |
152 | fi | |
153 | fi | |
69070f82 | 154 | @@ -261,7 +246,7 @@ |
947c1f7e | 155 | /sbin/modprobe -q -s --first-time $d |
bd5b695b ER |
156 | rc_check |
157 | if [ $? -ne 0 ] ; then | |
158 | - echo "`eval_gettext \"PowerPath could not load module \\$d\"`" | |
159 | + echo "`eval nls \"PowerPath could not load module \\$d\"`" | |
160 | break | |
161 | fi | |
947c1f7e | 162 | done |
69070f82 | 163 | @@ -318,8 +303,8 @@ |
947c1f7e ER |
164 | else |
165 | sleep 5 | |
166 | retry=`expr $retry - 1` | |
167 | - #echo "`eval_gettext \"PowerPath devices are open.\"`" | |
168 | - #echo "`eval_gettext \"Please close these devices and then re-issue \\$script_name stop.\"`" | |
169 | + #nls "PowerPath devices are open." | |
170 | + #eval echo "$(nls "Please close these devices and then re-issue \$script_name stop.")" | |
171 | #/bin/false | |
172 | #uerr=$? | |
173 | #return $uerr | |
69070f82 | 174 | @@ -334,14 +319,14 @@ |
947c1f7e ER |
175 | uerr=$? |
176 | return $uerr | |
177 | else | |
178 | - echo "`eval_gettext \"PowerPath devices are open.\"`" | |
179 | - echo "`eval_gettext \"Please close these devices and then re-issue \\$script_name stop.\"`" | |
180 | + nls "PowerPath devices are open." | |
181 | + eval echo "$(nls "Please close these devices and then re-issue \$script_name stop.")" | |
182 | /bin/false | |
183 | uerr=$? | |
184 | return $uerr | |
185 | fi | |
186 | ||
187 | - echo "`eval_gettext \"PowerPath could not unload PowerPath modules.\"`" | |
188 | + nls "PowerPath could not unload PowerPath modules." | |
189 | uerr=1 | |
190 | return $uerr | |
191 | } | |
69070f82 | 192 | @@ -358,20 +343,19 @@ |
947c1f7e ER |
193 | mknod /dev/emcpower c $mmaj $mmin > /dev/null |
194 | ||
195 | if [ $? -ne 0 ]; then | |
196 | - echo "`eval_gettext \"failed to create emcpower device\"`" | |
197 | + nls "failed to create emcpower device" | |
198 | fi | |
199 | ||
200 | } | |
442f6557 ER |
201 | |
202 | rc_reset | |
203 | script_name=PowerPath | |
204 | -ext=$PPBASE/bin/.drivers_ext | |
205 | -mgr=$PPBASE/bin/.drivers_mgr | |
206 | +ext=/etc/emc/.drivers_ext | |
207 | +mgr=/etc/emc/.drivers_mgr | |
208 | ||
8060c842 ER |
209 | case "$1" in |
210 | start) | |
442f6557 | 211 | - |
bd5b695b | 212 | - echo -n "`eval_gettext \"Starting \\$script_name: \"`" |
442f6557 | 213 | + msg_starting "PowerPath" |
bd5b695b ER |
214 | |
215 | ### | |
216 | # Start the 32-bit emulation for ia64 | |
69070f82 | 217 | @@ -387,7 +371,7 @@ |
442f6557 ER |
218 | lsmod | grep -w '^emcp' > /dev/null |
219 | if [ $? -ne 0 ]; then | |
220 | load_drivers | |
221 | - else | |
222 | + else | |
223 | if dev_emcpower_is_back 60; then | |
224 | recreate_emcpower_device | |
225 | /etc/opt/emcpower/powercf -K > /dev/null 2>&1 | |
69070f82 | 226 | @@ -396,10 +380,10 @@ |
442f6557 ER |
227 | rc_check |
228 | unload_drivers | |
229 | fi | |
230 | - # remove PIOC if it was loaded during RD boot. | |
231 | - lsmod | grep emcpioc > /dev/null | |
232 | - if [ $? -eq 0 ]; then | |
233 | - /sbin/rmmod emcpioc > /dev/null | |
234 | + # remove PIOC if it was loaded during RD boot. | |
235 | + lsmod | grep emcpioc > /dev/null | |
236 | + if [ $? -eq 0 ]; then | |
237 | + /sbin/rmmod emcpioc > /dev/null | |
238 | fi | |
239 | fi | |
240 | ||
69070f82 | 241 | @@ -411,7 +395,7 @@ |
bd5b695b ER |
242 | unload_drivers |
243 | fi | |
244 | else | |
245 | - echo "`eval_gettext \"PowerPath: unable to load PowerPath modules.\"`" | |
442f6557 | 246 | + nls "PowerPath: unable to load PowerPath modules." |
bd5b695b ER |
247 | unload_drivers |
248 | fi | |
249 | fi | |
69070f82 | 250 | @@ -419,11 +403,10 @@ |
bd5b695b ER |
251 | ;; |
252 | ||
253 | stop) | |
254 | - echo -n "`eval_gettext \"Stopping \\$script_name: \"`" | |
442f6557 | 255 | + msg_stopping "PowerPath" |
bd5b695b | 256 | lsmod | grep -w '^emcp' > /dev/null |
442f6557 ER |
257 | - if test $? -ne 0 ; |
258 | - then | |
bd5b695b | 259 | - echo "`eval_gettext \"PowerPath is not running\"`" |
442f6557 ER |
260 | + if test $? -ne 0; then |
261 | + nls "PowerPath is not running" | |
bd5b695b ER |
262 | else |
263 | # | |
264 | # Tresspass can happen if new devices are added or some devices | |
69070f82 | 265 | @@ -436,7 +419,7 @@ |
8060c842 ER |
266 | if ok_to_stop; then |
267 | /sbin/powermt save > /dev/null 2>&1 | |
268 | rc_check | |
269 | - /etc/opt/emcpower/emcpmgr unmap > /dev/null 2>&1 | |
d38200fa | 270 | + /sbin/emcpmgr unmap > /dev/null 2>&1 |
8060c842 ER |
271 | rc_check |
272 | /sbin/powermt remove dev=all 2> /var/tmp/.pp_exit | |
273 | devr=$? | |
69070f82 | 274 | @@ -451,21 +434,21 @@ |
947c1f7e ER |
275 | unload_drivers |
276 | rc_check | |
b954ffc3 ER |
277 | if [ $? -ne 0 ] ; then |
278 | - echo "`eval_gettext \"PowerPath could not unload PowerPath modules.\"`" | |
279 | + nls "PowerPath could not unload PowerPath modules." | |
280 | fi | |
947c1f7e ER |
281 | else |
282 | if [ $cdevs -eq 0 -o $zerolen -eq 0 ] ; then | |
283 | unload_drivers | |
284 | rc_check | |
285 | if [ $? -ne 0 ] ; then | |
286 | - echo "`eval_gettext \"PowerPath could not unload PowerPath modules.\"`" | |
287 | + nls "PowerPath could not unload PowerPath modules." | |
288 | fi | |
289 | else | |
290 | - echo "`eval_gettext \"PowerPath devices are open.\"`" | |
291 | - echo "`eval_gettext \"Please close these devices and then re-issue \\$script_name stop.\"`" | |
442f6557 | 292 | - /etc/opt/emcpower/emcpmgr map -p > /dev/null 2>&1 |
947c1f7e ER |
293 | + nls "PowerPath devices are open." |
294 | + eval echo "$(nls "Please close these devices and then re-issue \$script_name stop.")" | |
442f6557 | 295 | + /sbin/emcpmgr map -p > /dev/null 2>&1 |
947c1f7e | 296 | /sbin/powermt config > /dev/null 2>&1 |
442f6557 ER |
297 | - /sbin/powermt load > /dev/null 2>&1 |
298 | + /sbin/powermt load > /dev/null 2>&1 | |
299 | /bin/false | |
300 | fi | |
301 | fi | |
69070f82 | 302 | @@ -476,9 +459,10 @@ |
442f6557 | 303 | rc_status -v |
bd5b695b ER |
304 | ;; |
305 | *) | |
442f6557 | 306 | - var=$0 |
bd5b695b | 307 | - echo "`eval_gettext \"Usage: \\$var {start|stop}\"`" |
442f6557 ER |
308 | + msg_usage "$0 {start|stop}" |
309 | + exit 3 | |
bd5b695b ER |
310 | ;; |
311 | esac | |
312 | ||
947c1f7e ER |
313 | rc_exit |
314 | +# vim:ts=4:sw=4:et |