diff options
| author | Benjamin Marzinski <bmarzins@fedoraproject.org> | 2009-07-29 22:54:07 +0000 |
|---|---|---|
| committer | Benjamin Marzinski <bmarzins@fedoraproject.org> | 2009-07-29 22:54:07 +0000 |
| commit | c7ea1a3b8dbfdeb2020d25e5d847a1bb8513081f (patch) | |
| tree | 7b7ba020c69a2e01f3dd2a0d26911d1b18b548d0 /root_init_script.patch | |
| parent | 39c08730f0e8e5f001c3f9dc3481b9f30eab24fb (diff) | |
Updated to latest upstream 0.4.9 code : multipath-tools-090729.tgz (git
commit id: d678c139719d5631194b50e49f16ca97162ecd0f) moved multipath
bindings file from /var/lib/multipath to /etc/multipath Fixed 354961,
432520
Diffstat (limited to 'root_init_script.patch')
| -rw-r--r-- | root_init_script.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/root_init_script.patch b/root_init_script.patch new file mode 100644 index 0000000..1376b57 --- /dev/null +++ b/root_init_script.patch @@ -0,0 +1,70 @@ +Index: multipath-tools-090724/multipathd/multipathd.init.redhat +=================================================================== +--- multipath-tools-090724.orig/multipathd/multipathd.init.redhat ++++ multipath-tools-090724/multipathd/multipathd.init.redhat +@@ -2,7 +2,7 @@ + # + # multipathd Starts the multipath daemon + # +-# chkconfig: - 13 87 ++# chkconfig: - 06 87 + # description: Manages device-mapper multipath devices + + ### BEGIN INIT INFO +@@ -17,6 +17,7 @@ prog=`basename $DAEMON` + initdir=/etc/rc.d/init.d + lockdir=/var/lock/subsys + sysconfig=/etc/sysconfig ++syspath=/sys/block + + + . $initdir/functions +@@ -25,6 +26,36 @@ test -r $sysconfig/$prog && . $sysconfig + + RETVAL=0 + ++teardown_slaves() ++{ ++pushd $1 > /dev/null ++if [ -d "slaves" ]; then ++for slave in slaves/*; ++do ++ if [ "$slave" = "slaves/*" ]; then ++ read dev < $1/dev ++ tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"` ++ if ! [ -z $tablename ]; then ++ echo "Root is on a multipathed device, multipathd can not be stopped" ++ exit 1 ++ fi ++ else ++ local_slave=`readlink -f $slave`; ++ teardown_slaves $local_slave; ++ fi ++ done ++ ++else ++ read dev < $1/dev ++ tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"` ++ if ! [ -z $tablename ]; then ++ echo "Root is on a multipathed device, multipathd can not be stopped" ++ exit 1 ++ fi ++fi ++popd > /dev/null ++} ++ + # + # See how we were called. + # +@@ -39,6 +70,11 @@ start() { + } + + stop() { ++ root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab) ++ dm_num=`dmsetup info -c --noheadings -o minor $root_dev` ++ root_dm_device="dm-$dm_num" ++ [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device ++ + echo -n $"Stopping $prog daemon: " + killproc $DAEMON + RETVAL=$? |
