diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2010-05-20 06:46:34 +0200 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@opensvc.com> | 2010-05-20 06:46:34 +0200 |
commit | 07352dffc44c6e6b297d0c8cb804e6f08003be1d (patch) | |
tree | d2a64222c1c85b20ad12ca88194b1fe5a45ef21e | |
parent | e0cca4332f6299665b1a340735ebd62fddce9d23 (diff) | |
download | multipath-tools-07352dffc44c6e6b297d0c8cb804e6f08003be1d.tar.gz multipath-tools-07352dffc44c6e6b297d0c8cb804e6f08003be1d.tar.bz2 multipath-tools-07352dffc44c6e6b297d0c8cb804e6f08003be1d.zip |
update redhat multipathd init script
This patch adds the requested force-stop and force-restart to the init
script. It also keeps the init script for printing annoying error messages,
while checking the root device.
-rw-r--r-- | multipathd/multipathd.init.redhat | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/multipathd/multipathd.init.redhat b/multipathd/multipathd.init.redhat index e46b1b8..15b5753 100644 --- a/multipathd/multipathd.init.redhat +++ b/multipathd/multipathd.init.redhat @@ -7,6 +7,10 @@ ### BEGIN INIT INFO # Provides: multipathd +# Required-Start: +# Required-Stop: +# Default-Start: +# Default-Stop: # Short-Description: Control multipathd # Description: This service monitors and manages # device-mapper multipath devices @@ -69,12 +73,7 @@ start() { echo } -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 - +force_stop() { echo -n $"Stopping $prog daemon: " killproc $DAEMON RETVAL=$? @@ -82,10 +81,26 @@ stop() { echo } +stop() { + root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab) + dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null` + if [ $? -eq 0 ]; then + root_dm_device="dm-$dm_num" + [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device + fi + + force_stop +} + restart() { stop start -} +} + +force_restart() { + force_stop + start +} reload() { echo -n "Reloading $prog: " @@ -102,12 +117,18 @@ start) stop) stop ;; +force-stop) + force_stop + ;; force-reload|reload) reload ;; restart) restart ;; +force-restart) + force_restart + ;; condrestart|try-restart) if [ -f $lockdir/$prog ]; then restart @@ -118,7 +139,7 @@ status) RETVAL=$? ;; *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" + echo $"Usage: $0 {start|stop|force-stop|status|restart|force-restart|condrestart|reload}" RETVAL=2 esac |