On 05/23/2014 08:35 PM, Ritesh Raj Sarraf wrote: > I need to verify that. I'm not very sure how it would really behave. > > > What exactly is your requirement ? Do you want the init script to exit > clean irrespective of the module state ?
Hey Craig,
By the way, that is not the init scirpt that we ship in Debian. And for
the one that we ship, We are handling your case, as in your rmmod --wait
option.
# check if the module is loaded at all
lsmod | grep -q iscsi_trgt
RETVAL=$?
if [ $RETVAL = "0" ] ; then
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
else
log_end_msg 1
exit $RETVAL
fi
fi
--
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
signature.asc
Description: OpenPGP digital signature

