6 |
# chkconfig: - 15 85 |
# chkconfig: - 15 85 |
7 |
# description: multipath device monitoring and management |
# description: multipath device monitoring and management |
8 |
# |
# |
|
|
|
9 |
# Copyright 2002 Red Hat, Inc. |
# Copyright 2002 Red Hat, Inc. |
10 |
|
# |
11 |
|
### BEGIN INIT INFO |
12 |
|
# Default-Start: |
13 |
|
# Default-Stop: 0 1 2 3 4 5 6 |
14 |
|
# Short-Description: Start and stop the MD multipath monitor |
15 |
|
# Description: The mdmpd service checks the status of all MD based multipath |
16 |
|
# devices on the system. If a path to a device goes down, it removes |
17 |
|
# that path from the md multipath array. It also periodically attempts |
18 |
|
# to contact the device via the down path. When it succeeds repeatedly, |
19 |
|
# it re-adds the downed path to the multipath array. There is a roughly |
20 |
|
# 60 second delay between when a path becomes live again and when mdmpd |
21 |
|
# adds it back into service. |
22 |
|
### END INIT INFO |
23 |
|
|
24 |
|
|
25 |
PATH=/sbin:/usr/sbin:$PATH |
PATH=/sbin:/usr/sbin:$PATH |
26 |
RETVAL=0 |
RETVAL=0 |
45 |
|
|
46 |
start () |
start () |
47 |
{ |
{ |
48 |
|
[ `id -u` -eq 0 ] || return 4 |
49 |
|
[ -x /sbin/mdmpd ] || return 1 |
50 |
|
[ -f /var/lock/subsys/$prog ] && return 0 |
51 |
ulimit -S -c 0 >/dev/null 2>&1 |
ulimit -S -c 0 >/dev/null 2>&1 |
52 |
# clean up in case we went down unexpectedly |
# clean up in case we went down unexpectedly |
53 |
rm -f /var/run/$prog/* |
rm -f /var/run/$prog/* |
57 |
usleep 100000 |
usleep 100000 |
58 |
pid=`pidof -o $$ -o $PPID -o %PPID -x $prog` |
pid=`pidof -o $$ -o $PPID -o %PPID -x $prog` |
59 |
if [ -n "$pid" ] ; then |
if [ -n "$pid" ] ; then |
60 |
success $"mdmpd" |
echo_success |
61 |
touch /var/lock/subsys/$prog |
touch /var/lock/subsys/$prog |
62 |
echo "$pid" > /var/run/$prog.pid |
echo "$pid" > /var/run/$prog.pid |
63 |
RETVAL=0 |
RETVAL=0 |
64 |
else |
else |
65 |
failure $"mdmpd" |
echo_failure |
66 |
RETVAL=1 |
RETVAL=1 |
67 |
fi |
fi |
68 |
echo |
echo |
70 |
|
|
71 |
stop () |
stop () |
72 |
{ |
{ |
73 |
|
[ `id -u` -eq 0 ] || return 4 |
74 |
|
[ ! -f /var/lock/subsys/$prog ] && return 0 |
75 |
echo -n $"Stopping $prog: " |
echo -n $"Stopping $prog: " |
76 |
killproc $prog |
killproc $prog |
77 |
echo |
echo |
87 |
|
|
88 |
condrestart () |
condrestart () |
89 |
{ |
{ |
90 |
[ -e /var/lock/subsys/$prog ] && restart |
[ -e /var/lock/subsys/$prog ] && restart || return 0 |
91 |
} |
} |
92 |
|
|
93 |
|
|
94 |
case "$1" in |
case "$1" in |
95 |
start) start ;; |
start) start; RETVAL=$? ;; |
96 |
stop) stop ;; |
stop) stop; RETVAL=$? ;; |
97 |
status) status $prog ;; |
status) status $prog; RETVAL=$? ;; |
98 |
restart|reload) restart ;; |
restart|force-reload) restart; RETVAL=$? ;; |
99 |
condrestart) condrestart ;; |
condrestart|try-restart|reload) condrestart; RETVAL=$? ;; |
100 |
*) usage ;; |
*) usage; RETVAL=2 ;; |
101 |
esac |
esac |
102 |
|
|
103 |
exit $RETVAL |
exit $RETVAL |