On Tue, 2012-10-09 at 21:19 +0000, Nicholas A. Bellinger wrote: > From: Hannes Reinecke <hare@xxxxxxx> > > config/iscsi doesn't need to exist, yet the module can be loaded. > > (nab: Fix shutdown_lio_mod() to add missing 'if -ne' investor to > work properly, and add some code to scripts/rc.target) > > Signed-off-by: Hannes Reinecke <hare@xxxxxxx> > Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx> > --- > lio-py/lio_node.py | 17 +++++++++-------- > scripts/rc.target | 2 +- > scripts/rc.target.suse | 5 +++-- > 3 files changed, 13 insertions(+), 11 deletions(-) > <SNIP> > 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 > > diff --git a/scripts/rc.target.suse b/scripts/rc.target.suse > index 5e49f8f..a3806fa 100644 > --- a/scripts/rc.target.suse > +++ b/scripts/rc.target.suse > @@ -214,7 +214,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 > echo -n $"Unloading LIO-Target/ConfigFS fabric: " > ${LIO_NODE} --unload > rc_status -v Er duh, changing shutdown_lio_mod() to use the correct conditional inversion with in the following incremental patch. diff --git a/scripts/rc.target b/scripts/rc.target index d5243e2..b269ef3 100644 --- a/scripts/rc.target +++ b/scripts/rc.target @@ -282,7 +282,7 @@ function shutdown_fabrics() { } function shutdown_lio_mod () { - if -ne lsmod | grep -q iscsi_target_mod ; then + if ! lsmod | grep -q iscsi_target_mod ; then return 0 fi diff --git a/scripts/rc.target.suse b/scripts/rc.target.suse index a3806fa..5aa5283 100644 --- a/scripts/rc.target.suse +++ b/scripts/rc.target.suse @@ -214,7 +214,7 @@ function shutdown_fabrics() { } function shutdown_lio_mod () { - if -ne lsmod | grep -q iscsi_target_mod ; then + if ! lsmod | grep -q iscsi_target_mod ; then echo -n $"Unloading LIO-Target/ConfigFS fabric: " ${LIO_NODE} --unload rc_status -v -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html