chiark / gitweb /
860b2b11dbdd0d43e6a796abdbc5a3e380d1ba9e
[elogind.git] / extras / multipath-tools / multipathd / multipathd.init
1 #!/bin/sh
2
3 PATH=/bin:/usr/bin:/sbin:/usr/sbin
4 DAEMON=/usr/bin/multipathd
5 PIDFILE=/var/run/multipathd.pid
6
7 test -x $DAEMON || exit 0
8
9 case "$1" in
10   start)
11         echo -n "Starting multipath daemon: multipathd"
12         if start-stop-daemon --quiet --stop --signal 0 --pidfile $PIDFILE --name multipathd
13         then
14                 echo " already running."
15                 exit
16         fi
17         /sbin/start-stop-daemon --start --quiet --exec $DAEMON
18         echo "."
19         ;;
20   stop)
21         echo -n "Stopping multipath daemon: multipathd"
22         if start-stop-daemon --quiet --stop --signal 0 --pidfile $PIDFILE --name multipathd
23         then
24                 PID=`cat $PIDFILE`
25                 start-stop-daemon --quiet --stop --exec $DAEMON --pidfile $PIDFILE --name multipathd
26                 # Now we wait for it to die
27                 while kill -0 $PID 2>/dev/null; do sleep 1; done
28                 echo "."
29         else
30                 echo " not running.";
31         fi
32         ;;
33   force-reload|restart)
34         $0 stop
35         $0 start
36         ;;
37   *)
38         echo "Usage: /etc/init.d/multipathd {start|stop|restart|force-reload}"
39         exit 1
40 esac
41
42 exit 0