/etc/init.d/scst: Wait up to 30s before giving up trying to unload a kernel module (merge r4608 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4689 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2013-01-06 09:44:06 +00:00
parent e48b528b79
commit 1dd3cb834d

View File

@@ -181,7 +181,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