Lines 1-35
Link Here
|
1 |
#!/bin/sh |
1 |
#!/sbin/runscript |
2 |
|
2 |
|
3 |
PATH=/bin:/usr/bin:/sbin:/usr/sbin |
3 |
depend() { |
4 |
DAEMON=/usr/bin/multipathd |
4 |
need modules |
5 |
PIDFILE=/var/run/multipathd.pid |
5 |
} |
6 |
|
6 |
|
7 |
test -x $DAEMON || exit 0 |
7 |
start() { |
|
|
8 |
PIDFILE="/var/run/multipathd.pid" |
9 |
ebegin "Starting multipath daemon: multipathd" |
10 |
/usr/bin/multipathd >/dev/null 2>&1 |
11 |
|
12 |
while : |
13 |
do |
14 |
cnt=$(($cnt + 1)) |
15 |
if [ -f ${PIDFILE} ]; then |
16 |
ret=0 |
17 |
break |
18 |
fi |
8 |
|
19 |
|
9 |
case "$1" in |
20 |
if [ $cnt -eq 5 ]; then |
10 |
start) |
21 |
eerror "Unable to start multipathd" |
11 |
echo -n "Starting multipath daemon: multipathd" |
22 |
ret=1 |
12 |
$DAEMON |
23 |
break |
13 |
echo "." |
24 |
fi |
14 |
;; |
25 |
sleep 1 |
15 |
stop) |
26 |
done |
16 |
echo -n "Stopping multipath daemon: multipathd" |
27 |
eend $ret |
17 |
echo "." |
28 |
} |
18 |
if [ -f $PIDFILE ] |
29 |
|
|
|
30 |
stop () { |
31 |
PIDFILE="/var/run/multipathd.pid" |
32 |
ebegin "Stopping multipath daemon: multipathd" |
33 |
if [ -f ${PIDFILE} ] |
19 |
then |
34 |
then |
20 |
kill `cat $PIDFILE` |
35 |
kill `cat ${PIDFILE}` |
21 |
else |
36 |
else |
22 |
echo "multipathd not running: Nothing to stop..." |
37 |
eerror "multipathd not running: Nothing to stop..." |
|
|
38 |
return 1 |
23 |
fi |
39 |
fi |
24 |
;; |
40 |
eend $? |
25 |
force-reload|restart) |
41 |
} |
26 |
$0 stop |
|
|
27 |
$0 start |
28 |
;; |
29 |
*) |
30 |
echo "Usage: /etc/init.d/multipathd {start|stop|restart|force-reload}" |
31 |
exit 1 |
32 |
;; |
33 |
esac |
34 |
|
35 |
exit 0 |