[ewg] [PATCH 1/2] IB/iser: Logout from open-iscsi over iSER sessions before stopping openibd

Erez Zilber erezz at voltaire.com
Thu Apr 10 07:48:33 PDT 2008


Some users may try to stop openibd while open-iscsi over iSER is
running. When stopping openibd, the script should check if there
are open-iscsi sessions that use the iSER transport and ask the
user to logout from these sessions before shutting down openibd.

Signed-off-by: Erez Zilber <erezz at voltaire.com>
---
 ofed_scripts/openibd |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ofed_scripts/openibd b/ofed_scripts/openibd
index 4e317a7..0e1325d 100755
--- a/ofed_scripts/openibd
+++ b/ofed_scripts/openibd
@@ -1190,6 +1190,19 @@ stop()
             fi
         done
 
+        # Check if open-iscsi is running and if there are open iSER sessions
+        if [ $(pidof iscsid | wc -w) -gt 0 ]; then
+                iser_session_cnt=$(iscsiadm -m session 2>&1 | grep -c "^iser")
+
+                if [ $iser_session_cnt -gt 0 ]; then
+                        echo
+                        echo "Please logout from all open-iscsi over iSER sessions"
+                        echo "Then run \"$0 $ACTION\""
+                        echo
+                        exit 1
+                fi
+        fi
+
         # Stop Gen1 modules if they are UP after uninstall
         if is_module ib_tavor; then
                     stop_gen1
-- 
1.5.4.4





More information about the ewg mailing list