3 # multipathd Starts the multipath daemon
6 # description: Manages device-mapper multipath devices
14 # Short-Description: Control multipathd
15 # Description: This service monitors and manages
16 # device-mapper multipath devices
19 DAEMON=/sbin/multipathd
20 prog=`basename $DAEMON`
21 initdir=/etc/rc.d/init.d
22 lockdir=/var/lock/subsys
23 sysconfig=/etc/sysconfig
29 test -r $sysconfig/$prog && . $sysconfig/$prog
36 if [ -d "slaves" ]; then
37 for slave in slaves/*;
39 if [ "$slave" = "slaves/*" ]; then
41 tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
42 if ! [ -z $tablename ]; then
43 echo "Root is on a multipathed device, multipathd can not be stopped"
47 local_slave=`readlink -f $slave`;
48 teardown_slaves $local_slave;
54 tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
55 if ! [ -z $tablename ]; then
56 echo "Root is on a multipathed device, multipathd can not be stopped"
64 # See how we were called.
68 test -x $DAEMON || exit 5
69 echo -n $"Starting $prog daemon: "
72 [ $RETVAL -eq 0 ] && touch $lockdir/$prog
77 echo -n $"Stopping $prog daemon: "
80 [ $RETVAL -eq 0 ] && rm -f $lockdir/$prog
85 root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab)
86 dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null`
88 root_dm_device="dm-$dm_num"
89 [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device
106 echo -n "Reloading $prog: "
108 killproc $DAEMON -HUP
132 condrestart|try-restart)
133 if [ -f $lockdir/$prog ]; then
142 echo $"Usage: $0 {start|stop|force-stop|status|restart|force-restart|condrestart|reload}"