main/multipath-tools: fix device node creation at boot. Add openrc weak depends on lvm and iscsid

(cherry picked from commit 65c253c0e11fbc622212b83fca2e0eae4702ac75)
This commit is contained in:
Leonardo Arena 2011-08-24 14:30:13 +00:00
parent c5232b17ef
commit 00c8e05743
3 changed files with 21 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Leonardo Arena <rnalrd@gmail.com>
pkgname="multipath-tools"
pkgver=0.4.9
pkgrel=3
pkgrel=4
pkgdesc="Device Mapper Multipathing Driver"
url="http://christophe.varoqui.free.fr/"
license="GPL"
@ -38,6 +38,7 @@ package() {
cd $_builddir
make DESTDIR="$pkgdir" install
install -D -m644 ../$pkgname.conf $pkgdir/etc/multipath.conf
install -D -m644 ../$pkgname.confd $pkgdir/etc/conf.d/multipathd
install -D -m755 ../$pkgname.initd $pkgdir/etc/init.d/multipathd
}

View File

@ -0,0 +1,2 @@
rc_before="lvm"
rc_after="iscsid"

View File

@ -7,14 +7,30 @@ 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 --exec /sbin/multipathd
do_nodes()
eend $?
}
stop() {
ebegin "Stopping multipathd"
start-stop-daemon --stop --quiet --pidfile /var/run/multipathd.pid
undo_nodes()
start-stop-daemon --stop --quiet --retry --pidfile /var/run/multipathd.pid
eend $?
}