While stopping open-iscsi, the initd script removes
the modules by running 'modprobe -r'. The retval of
modprobe must be tested.

Signed-off-by: Doron Shoham <[EMAIL PROTECTED]>
---
 etc/initd/initd.debian |    9 ++++++++-
 etc/initd/initd.redhat |   13 ++++++++++++-
 etc/initd/initd.suse   |    9 ++++++++-
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/etc/initd/initd.debian b/etc/initd/initd.debian
index 9e9f134..00b644e 100644
--- a/etc/initd/initd.debian
+++ b/etc/initd/initd.debian
@@ -54,9 +54,16 @@ stop() {
        log_daemon_msg "Stopping iSCSI initiator service"
        start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
        rm -f $PIDFILE
+       status=0
        modprobe -r ib_iser 2>/dev/null
+       if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+               status=1
+       fi
        modprobe -r iscsi_tcp 2>/dev/null
-       log_end_msg 0
+       if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+               status=1
+       fi
+       log_end_msg $status
 }
 
 restart() {
diff --git a/etc/initd/initd.redhat b/etc/initd/initd.redhat
index 7cf198e..d68f135 100644
--- a/etc/initd/initd.redhat
+++ b/etc/initd/initd.redhat
@@ -42,9 +42,20 @@ stop()
        killproc iscsid
        rm -f /var/run/iscsid.pid
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-iscsi
+       status=0
        modprobe -r iscsi_tcp 2>/dev/null
+       if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+               status=1
+       fi
        modprobe -r ib_iser 2>/dev/null
-       success
+       if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+               status=1
+       fi
+       if [ "$status" -eq "0" ]; then
+               success
+       else
+               failure
+       fi
        echo
 
 }
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index 163479e..f5009d2 100644
--- a/etc/initd/initd.suse
+++ b/etc/initd/initd.suse
@@ -88,9 +88,16 @@ case "$1" in
        echo -n "Stopping iSCSI initiator service: "
        if [ "$RETVAL" == "0" ]; then
            rm -f $PID_FILE
+           status=0
            modprobe -r iscsi_tcp
+           if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+               status=1
+           fi
            modprobe -q -r ib_iser
-           rc_failed 0
+            if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+               status=1 
+            fi
+           rc_failed $status
        else
            rc_failed 1
        fi
-- 
1.5.3.7
  


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to