On Wednesday 10 October 2012 02:49 AM, Nicholas A. Bellinger wrote: > @@ -1224,10 +1223,12 @@ def lio_target_unload(option, opt_str, value, parser): > > __lio_target_del_iqn(None, None, iqn, None, 0) > > - rmdir_op = "rmdir " + lio_root > - ret = os.system(rmdir_op) > - if ret: > - print "Unable to release lio_root: " + lio_root > + > + if iqn_root: > + rmdir_op = "rmdir " + lio_root > + ret = os.system(rmdir_op) > + if ret: > + print "Unable to remove lio_root: " + lio_root > Won't a simple os.rmdir() work here? > rmmod_op = "rmmod iscsi_target_mod" > ret = os.system(rmmod_op) > diff --git a/scripts/rc.target b/scripts/rc.target > index 7ad75a3..d5243e2 100644 > --- a/scripts/rc.target > +++ b/scripts/rc.target > @@ -282,7 +282,7 @@ function shutdown_fabrics() { > } > > function shutdown_lio_mod () { > - if [ ! -d /sys/kernel/config/target/iscsi/ ]; then > + if -ne lsmod | grep -q iscsi_target_mod ; then > return 0 > fi > I was wondering if we should get away from relying on the binaries residing on the disk. Would it be worth to look at /proc/modules instead? -- Ritesh Raj Sarraf | http://people.debian.org/~rrs Debian - The Universal Operating System
Attachment:
signature.asc
Description: OpenPGP digital signature