This commit is contained in:
mchristi 2011-02-20 04:24:00 +00:00
parent 41e86a17f5
commit 600a051a70
3 changed files with 34 additions and 18 deletions

View File

@ -3,7 +3,7 @@
Summary: iSCSI daemon and utility programs Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils Name: iscsi-initiator-utils
Version: 6.2.0.872 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 Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc4-bnx2i.tar.gz
Source1: iscsid.init Source1: iscsid.init
Source2: iscsidevs.init Source2: iscsidevs.init
@ -209,6 +209,10 @@ fi
%{_includedir}/libiscsi.h %{_includedir}/libiscsi.h
%changelog %changelog
* Sat Feb 19 2011 Mike Christie <mcrhsit@redhat.com> 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 <akozumpl@redhat.com> 6.2.0.872.16 * Wed Feb 9 2011 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.16
- 529443 fwparam_sysfs: fix pathname manipulation error in - 529443 fwparam_sysfs: fix pathname manipulation error in
fwparam_sysfs_boot_info. fwparam_sysfs_boot_info.

View File

@ -34,7 +34,7 @@ root_is_iscsi() {
[[ "$rootopts" =~ "_netdev" ]] [[ "$rootopts" =~ "_netdev" ]]
} }
force_start() { start_iscsid() {
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
modprobe -q iscsi_tcp modprobe -q iscsi_tcp
modprobe -q ib_iser modprobe -q ib_iser
@ -47,6 +47,10 @@ force_start() {
retval=$? retval=$?
echo echo
touch $lockfile touch $lockfile
}
force_start() {
start_iscsid
# a force start could imply the iscsi service is started due to how it # 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 # lazy starts. We need to touch the lock file so it is shutdown later
touch $iscsi_lockfile touch $iscsi_lockfile
@ -74,7 +78,7 @@ start() {
# or if iscsid is managing the sessions. # or if iscsid is managing the sessions.
grep -qrs "node.startup = automatic" /var/lib/iscsi/nodes grep -qrs "node.startup = automatic" /var/lib/iscsi/nodes
if [ $? -eq 0 ] || root_is_iscsi || use_discoveryd ; then if [ $? -eq 0 ] || root_is_iscsi || use_discoveryd ; then
force_start start_iscsid
return $? return $?
fi fi
@ -131,7 +135,7 @@ restart() {
stop stop
# if iscsid was running then make sure it starts up # if iscsid was running then make sure it starts up
if [ "$use_force_start" -eq 0 ] ; then if [ "$use_force_start" -eq 0 ] ; then
force_start start_iscsid
else else
start start
fi fi

View File

@ -58,6 +58,22 @@ start() {
return 0 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() { stop() {
# Don't turn off iscsi if root is possibly on a iscsi disk. # Don't turn off iscsi if root is possibly on a iscsi disk.
rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab)
@ -74,6 +90,11 @@ stop() {
echo -n $"Stopping $prog: " 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 if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
$exec -m node --logoutall=all 2>&1 > /dev/null $exec -m node --logoutall=all 2>&1 > /dev/null
else else
@ -88,9 +109,7 @@ stop() {
return 1 return 1
fi fi
success $"Stopping $prog" cleanup_successful_stop
rm -f $lockfile
echo
return 0 return 0
} }
@ -107,16 +126,6 @@ force_reload() {
restart 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() { rh_status() {
[ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; } [ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; }
@ -142,7 +151,6 @@ case "$1" in
$1 $1
;; ;;
stop) stop)
iscsi_sessions_running || exit 0
$1 $1
;; ;;
restart) restart)