From 37431aae607f3ba00d987e1ceeb86b205b7f26a9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 8 Nov 2012 14:23:13 +0000 Subject: [PATCH] /etc/init.d/scst: Wait up to 30s before giving up trying to unload a kernel module git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4608 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/init.d/scst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scstadmin/init.d/scst b/scstadmin/init.d/scst index a2d34ad9d..027b7b9a8 100755 --- a/scstadmin/init.d/scst +++ b/scstadmin/init.d/scst @@ -180,7 +180,12 @@ unload_scst() { # occurs, sleep for a short time. sleep 1 fi - if [ -e /sys/module/$m/refcnt ] && ! rmmod $m; then + i=0 + while [ -e /sys/module/$m/refcnt ] && ! rmmod $m && [ $i -lt 30 ]; do + sleep 1 + i=$((i+1)) + done + if [ -e /sys/module/$m/refcnt ]; then return 1 fi done