diff --git a/iscsi-initiator-utils-start-iscsid.patch b/iscsi-initiator-utils-start-iscsid.patch index a3cdf89..859ad5b 100644 --- a/iscsi-initiator-utils-start-iscsid.patch +++ b/iscsi-initiator-utils-start-iscsid.patch @@ -36,7 +36,7 @@ diff -up open-iscsi-2.0-870-rc1/usr/iscsiadm.c.start-iscsid open-iscsi-2.0-870-r memset(&req, 0, sizeof(req)); req.command = MGMT_IPC_IMMEDIATE_STOP; - rc = do_iscsid(&req, &rsp); -+ rc = do_iscsid(&req, &rsp, 1); ++ rc = do_iscsid(&req, &rsp, 0); if (rc) { iscsid_handle_error(rc); log_error("Could not stop iscsid. Trying sending iscsid " @@ -129,7 +129,7 @@ diff -up open-iscsi-2.0-870-rc1/usr/util.c.start-iscsid open-iscsi-2.0-870-rc1/u - break; + if (errno == ECONNREFUSED) { + if (iscsid_start && nsec == 1) -+ system("/etc/rc.d/init.d/iscsid start"); ++ system("/etc/rc.d/init.d/iscsid force-start"); + else + break; + } diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 9712c26..3fcc4c9 100644 --- a/iscsi-initiator-utils.spec +++ b/iscsi-initiator-utils.spec @@ -1,7 +1,7 @@ Summary: iSCSI daemon and utility programs Name: iscsi-initiator-utils Version: 6.2.0.870 -Release: 0.1.rc1%{?dist} +Release: 0.2.rc1%{?dist} Source0: http://www.open-iscsi.org/bits/open-iscsi-2.0-870-rc1.tar.gz Source1: iscsid.init Source2: iscsidevs.init @@ -117,6 +117,13 @@ fi %changelog +* Thu Nov 6 2008 Hans de Goede 6.2.0.870-0.2.rc1 +- Add force-start iscsid initscript option and use that in "patch to make + iscsiadm start iscsid when needed" so that iscsid will actual be started + even if there are no iscsi disks configured yet (rh 470437) +- Do not start iscsid when not running when iscsiadm -k 0 gets executed + (rh 470438) + * Tue Sep 30 2008 Hans de Goede 6.2.0.870-0.1.rc1 - Rewrite SysV initscripts, fixes rh 441290, 246960, 282001, 436175, 430791 - Add patch to make iscsiadm complain and exit when run as user instead diff --git a/iscsid.init b/iscsid.init index 7d616a1..035faee 100755 --- a/iscsid.init +++ b/iscsid.init @@ -33,6 +33,17 @@ root_is_iscsi() { [[ "$rootopts" =~ "_netdev" ]] } +force_start() { + echo -n $"Starting $prog: " + modprobe -q iscsi_tcp + modprobe -q ib_iser + daemon $prog + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + start() { [ -x $exec ] || exit 5 [ -f $config ] || exit 6 @@ -40,14 +51,8 @@ start() { # only start if nodes are setup to startup automatically or root is iscsi grep -qrs "node.startup = automatic" /var/lib/iscsi/nodes if [ $? -eq 0 ] || root_is_iscsi; then - echo -n $"Starting $prog: " - modprobe -q iscsi_tcp - modprobe -q ib_iser - daemon $prog - retval=$? - echo - [ $retval -eq 0 ] || return 1 - touch $lockfile + force_start + return $? fi return 0 @@ -102,6 +107,9 @@ case "$1" in rh_status_q && exit 0 $1 ;; + force-start) + force_start + ;; stop) rh_status_q || exit 0 $1