summaryrefslogtreecommitdiff
path: root/system/multipath-tools/rc.multipathd.new
diff options
context:
space:
mode:
Diffstat (limited to 'system/multipath-tools/rc.multipathd.new')
-rw-r--r--system/multipath-tools/rc.multipathd.new44
1 files changed, 44 insertions, 0 deletions
diff --git a/system/multipath-tools/rc.multipathd.new b/system/multipath-tools/rc.multipathd.new
new file mode 100644
index 0000000000..e62690fa8f
--- /dev/null
+++ b/system/multipath-tools/rc.multipathd.new
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# This is usually needed for detecting multipaths. The default 5 seems
+# to work, but adjustment per case may be needed.
+SLEEP=5
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/sbin/multipathd
+
+test -x $DAEMON || exit 0
+
+case "$1" in
+ start)
+ pgrep -f $DAEMON >/dev/null
+ if [ $? = 0 ]; then
+ echo 'multipathd is already running'
+ exit 1
+ fi
+ echo -n "Starting multipath daemon: $DAEMON ."
+ $DAEMON
+ echo -n '.'; sleep $SLEEP; echo -n '. '
+ pgrep -f $DAEMON >/dev/null
+ if [ $? = 0 ]; then
+ echo "ok"
+ else
+ echo "error!"
+ fi
+ ;;
+ stop)
+ echo -n "Stopping multipath daemon: multipathd ... "
+ $DAEMON shutdown || echo "daemon is not running"
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/multipathd {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+