aboutsummaryrefslogtreecommitdiffstats
path: root/main/multipath-tools/multipath-tools.initd
blob: 14f28efccffaf6e913b88b212c540661cb96daf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/sbin/openrc-run
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/sys-fs/multipath-tools/files/rc-multipathd,v 1.5 2009/03/17 22:48:13 solar Exp $

depend() {
	after firewall
}

do_nodes() {
	for dev in $(ls /dev/mapper/mpath*)
	do
		kpartx -a $dev
	done
}

undo_nodes() {
	for dev in $(ls /dev/mapper/mpath*)
	do
		kpartx -d $dev
	done
}

start() {
	ebegin "Starting multipathd"
	start-stop-daemon --start --quiet --make-pidfile \
	 --pidfile /var/run/multipathd.pid --exec /sbin/multipathd
	do_nodes
	eend $?
}

stop() {
	ebegin "Stopping multipathd"
	undo_nodes
	start-stop-daemon --stop --quiet --retry --pidfile /var/run/multipathd.pid
	eend $?
}