From 600a051a70abd4d0c27d6e1fbdcd44d988396b08 Mon Sep 17 00:00:00 2001 From: mchristi Date: Feb 20 2011 04:24:00 +0000 Subject: Resolves: #634021 --- diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 002c8aa..f463422 100644 --- a/iscsi-initiator-utils.spec +++ b/iscsi-initiator-utils.spec @@ -3,7 +3,7 @@ Summary: iSCSI daemon and utility programs Name: iscsi-initiator-utils Version: 6.2.0.872 -Release: 16%{?dist} +Release: 17%{?dist} Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc4-bnx2i.tar.gz Source1: iscsid.init Source2: iscsidevs.init @@ -209,6 +209,10 @@ fi %{_includedir}/libiscsi.h %changelog +* Sat Feb 19 2011 Mike Christie 6.2.0.872.17 +- 634021 Fix in .14 added regression during iscsi startup that prevented +sessions from getting created. + * Wed Feb 9 2011 Ales Kozumplik 6.2.0.872.16 - 529443 fwparam_sysfs: fix pathname manipulation error in fwparam_sysfs_boot_info. diff --git a/iscsid.init b/iscsid.init index c362f13..b0d1cf1 100755 --- a/iscsid.init +++ b/iscsid.init @@ -34,7 +34,7 @@ root_is_iscsi() { [[ "$rootopts" =~ "_netdev" ]] } -force_start() { +start_iscsid() { echo -n $"Starting $prog: " modprobe -q iscsi_tcp modprobe -q ib_iser @@ -47,6 +47,10 @@ force_start() { retval=$? echo touch $lockfile +} + +force_start() { + start_iscsid # a force start could imply the iscsi service is started due to how it # lazy starts. We need to touch the lock file so it is shutdown later touch $iscsi_lockfile @@ -74,7 +78,7 @@ start() { # or if iscsid is managing the sessions. grep -qrs "node.startup = automatic" /var/lib/iscsi/nodes if [ $? -eq 0 ] || root_is_iscsi || use_discoveryd ; then - force_start + start_iscsid return $? fi @@ -131,7 +135,7 @@ restart() { stop # if iscsid was running then make sure it starts up if [ "$use_force_start" -eq 0 ] ; then - force_start + start_iscsid else start fi diff --git a/iscsidevs.init b/iscsidevs.init index caecf2c..ebb0b8b 100755 --- a/iscsidevs.init +++ b/iscsidevs.init @@ -58,6 +58,22 @@ start() { return 0 } +iscsi_sessions_running() { + declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") ) + if [[ -z "${iparams[*]}" ]]; then + # no sessions + return 2 + fi + + return 0 +} + +cleanup_successful_stop() { + success $"Stopping $prog" + rm -f $lockfile + echo +} + stop() { # Don't turn off iscsi if root is possibly on a iscsi disk. rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) @@ -74,6 +90,11 @@ stop() { echo -n $"Stopping $prog: " + if ! iscsi_sessions_running ; then + cleanup_successful_stop + return 0 + fi + if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then $exec -m node --logoutall=all 2>&1 > /dev/null else @@ -88,9 +109,7 @@ stop() { return 1 fi - success $"Stopping $prog" - rm -f $lockfile - echo + cleanup_successful_stop return 0 } @@ -107,16 +126,6 @@ force_reload() { restart } -iscsi_sessions_running() { - declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") ) - if [[ -z "${iparams[*]}" ]]; then - # no sessions - return 2 - fi - - return 0 -} - rh_status() { [ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; } @@ -142,7 +151,6 @@ case "$1" in $1 ;; stop) - iscsi_sessions_running || exit 0 $1 ;; restart)