1 From e6a23cc9de85a66d774567515592bdbdba7b2ca4 Mon Sep 17 00:00:00 2001
2 From: Fabio M. Di Nitto <fdinitto@redhat.com>
3 Date: Tue, 13 Oct 2009 08:19:01 +0200
4 Subject: [PATCH 03/12] RH: root init script
6 Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
8 :100644 100644 ee776f0... e46b1b8... M multipathd/multipathd.init.redhat
9 multipathd/multipathd.init.redhat | 38 ++++++++++++++++++++++++++++++++++++-
10 1 files changed, 37 insertions(+), 1 deletions(-)
12 diff --git a/multipathd/multipathd.init.redhat b/multipathd/multipathd.init.redhat
13 index ee776f0..e46b1b8 100644
14 --- a/multipathd/multipathd.init.redhat
15 +++ b/multipathd/multipathd.init.redhat
18 # multipathd Starts the multipath daemon
22 # description: Manages device-mapper multipath devices
25 @@ -17,6 +17,7 @@ prog=`basename $DAEMON`
26 initdir=/etc/rc.d/init.d
27 lockdir=/var/lock/subsys
28 sysconfig=/etc/sysconfig
33 @@ -25,6 +26,36 @@ test -r $sysconfig/$prog && . $sysconfig/$prog
40 +if [ -d "slaves" ]; then
41 +for slave in slaves/*;
43 + if [ "$slave" = "slaves/*" ]; then
45 + tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
46 + if ! [ -z $tablename ]; then
47 + echo "Root is on a multipathed device, multipathd can not be stopped"
51 + local_slave=`readlink -f $slave`;
52 + teardown_slaves $local_slave;
58 + tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
59 + if ! [ -z $tablename ]; then
60 + echo "Root is on a multipathed device, multipathd can not be stopped"
68 # See how we were called.
70 @@ -39,6 +70,11 @@ start() {
74 + root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab)
75 + dm_num=`dmsetup info -c --noheadings -o minor $root_dev`
76 + root_dm_device="dm-$dm_num"
77 + [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device
79 echo -n $"Stopping $prog daemon: "