/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
This commit is contained in:
Bart Van Assche
2012-11-08 14:23:13 +00:00
parent d3dc18dacb
commit 37431aae60
+6 -1
View File
@@ -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