[Pkg-iscsi-maintainers] Bug#679515: iscsitarget: init script fails to wait before unloading module during stop
David Mohr
bugs at da.mcbf.net
Fri Jun 29 10:14:38 UTC 2012
Package: iscsitarget
Version: 1.4.20.2-10
Severity: normal
Tags: patch
Hi,
on busy machines unloading the iscsitarget module is not immediately
possible after stopping the userspace daemon. The attached patch
introduces a flexible sleep time before unloading the module.
This is specially important on HA setups where open files may cause a
failover to fail.
Thanks,
~David
-- System Information:
Debian Release: 6.0.4
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Versions of packages iscsitarget depends on:
ii libc6 2.11.3-2 Embedded GNU C Library: Shared lib
ii lsb-base 3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii procps 1:3.2.8-9 /proc file system utilities
Versions of packages iscsitarget recommends:
pn iscsitarget-module <none> (no description available)
Versions of packages iscsitarget suggests:
pn iscsitarget-dkms <none> (no description available)
pn iscsitarget-source <none> (no description available)
-------------- next part --------------
--- a/debian/iscsitarget.init 2012-06-29 09:55:32.287495190 +0000
+++ b/debian/iscsitarget.init 2012-06-29 10:01:53.227992044 +0000
@@ -19,6 +19,7 @@
. /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 @@
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: "
+ # give iet some time to finish processing
+ sleep 1
+ modprobe -r iscsi_trgt
+ RETVAL=$?
+ if [ $RETVAL = "0" ]; then
+ break
+ fi
+ done
+
modprobe -r crc32c 2>/dev/null
if [ $RETVAL = "0" ]; then
log_end_msg 0
--- a/debian/iscsitarget.default 2012-06-29 09:58:10.215578518 +0000
+++ b/debian/iscsitarget.default 2012-06-29 09:58:33.208716552 +0000
@@ -1,4 +1,5 @@
ISCSITARGET_ENABLE=false
+ISCSITARGET_MAX_SLEEP=3
# ietd options
More information about the Pkg-iscsi-maintainers
mailing list