[Pkg-iscsi-maintainers] [iscsitarget] 04/07: Try harder to unload the kernel module

Ritesh Raj Sarraf rrs at alioth.debian.org
Thu Sep 26 14:40:43 UTC 2013


This is an automated email from the git hooks/post-receive script.

rrs pushed a commit to branch master
in repository iscsitarget.

commit 6e183367af0fa90cc2b0f1afb26fbe2b383576b9
Author: Ritesh Raj Sarraf <rrs at debian.org>
Date:   Thu Sep 26 18:11:28 2013 +0530

    Try harder to unload the kernel module
    
    Slightly modified the patch to avoid a 1 second delay
    
    Thanks: David Mohr
    Closes: #679515
---
 debian/iscsitarget.default |    1 +
 debian/iscsitarget.init    |   15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/debian/iscsitarget.default b/debian/iscsitarget.default
index 63f2686..2ed3f30 100644
--- a/debian/iscsitarget.default
+++ b/debian/iscsitarget.default
@@ -1,4 +1,5 @@
 ISCSITARGET_ENABLE=false
+ISCSITARGET_MAX_SLEEP=3
 
 
 # ietd options
diff --git a/debian/iscsitarget.init b/debian/iscsitarget.init
index 4237e06..33413dc 100644
--- a/debian/iscsitarget.init
+++ b/debian/iscsitarget.init
@@ -19,6 +19,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
 . /lib/lsb/init-functions # log_{warn,failure}_msg
 
 ISCSITARGET_ENABLE=false
+ISCSITARGET_MAX_SLEEP=3
 ISCSITARGET_DEFAULTS_FILE=/etc/default/iscsitarget
 if [ -s "$ISCSITARGET_DEFAULTS_FILE" ]; then
     . "$ISCSITARGET_DEFAULTS_FILE"
@@ -91,9 +92,17 @@ ietd_stop()
 	RETVAL=$?
 	if [ $RETVAL = "0" ] ; then
 		
-		log_daemon_msg "Removing iSCSI enterprise target modules: "
-		modprobe -r iscsi_trgt
-		RETVAL=$?
+		for i in $(seq $ISCSITARGET_MAX_SLEEP); do
+			log_daemon_msg "Removing iSCSI enterprise target modules: "
+			modprobe -r iscsi_trgt
+			RETVAL=$?
+			if [ $RETVAL = "0" ]; then
+				break
+			fi
+			# give iet some time to finish processing
+			sleep 1
+		done
+
 		modprobe -r crc32c 2>/dev/null
 		if [ $RETVAL = "0" ]; then
 			log_end_msg 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-iscsi/iscsitarget.git



More information about the Pkg-iscsi-maintainers mailing list