From 2d4a526aa698f3a2659e97ffd26a74aab9d5952d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Apr 26 2011 11:16:33 +0000 Subject: systemd related fixes -Fix iscsid autostarting when upgrading from an older version (add iscsid.startup key to iscsid.conf on upgrade) -Fix printing of [ OK ] when successfully stopping iscsid -Add Should-Start/Stop tgtd to iscsi init script to fix (re)boot from hanging when using locally hosted targets -%%ghost /var/lock/iscsi and contents (#656605) --- diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index cf14eff..a2292c8 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: 10%{?dist} +Release: 11%{?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 @@ -120,6 +120,9 @@ install -p -m 644 libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir} install -p -m 755 libiscsi/build/lib.linux-*/libiscsimodule.so \ $RPM_BUILD_ROOT%{python_sitearch} +# for %%ghost +touch $RPM_BUILD_ROOT/var/lock/iscsi/lock + %clean rm -rf $RPM_BUILD_ROOT @@ -133,6 +136,13 @@ if [ "$1" -eq "1" ]; then /sbin/chkconfig --add iscsid /sbin/chkconfig --add iscsi fi +# To make sure iscsid autostart works when upgrading from a version which +# did not have this in its config file +if ! grep -q 'iscsid\.startup' %{_sysconfdir}/iscsi/iscsid.conf; then + echo -e "\n\n# For iscsid autostart" \ + "\niscsid.startup = /etc/rc.d/init.d/iscsid force-start" >> \ + %{_sysconfdir}/iscsi/iscsid.conf +fi %postun -p /sbin/ldconfig @@ -158,7 +168,8 @@ fi %dir %{_var}/lib/iscsi/slp %dir %{_var}/lib/iscsi/ifaces %dir %{_var}/lib/iscsi/send_targets -%dir %{_var}/lock/iscsi +%ghost %{_var}/lock/iscsi +%ghost %{_var}/lock/iscsi/lock %{_initrddir}/iscsi %{_initrddir}/iscsid %{_sysconfdir}/NetworkManager/dispatcher.d/04-iscsi @@ -176,8 +187,17 @@ fi %{_includedir}/libiscsi.h %changelog -* Mon Apr 25 2011 Mike Christie 6.2.0.872.10 -- Fix iscsi init scripts check for networking being up. +* Tue Apr 26 2011 Hans de Goede - 6.2.0.872-11 +- Fix iscsid autostarting when upgrading from an older version + (add iscsid.startup key to iscsid.conf on upgrade) +- Fix printing of [ OK ] when successfully stopping iscsid +- systemd related fixes: + - Add Should-Start/Stop tgtd to iscsi init script to fix (re)boot from + hanging when using locally hosted targets + - %%ghost /var/lock/iscsi and contents (#656605) + +* Mon Apr 25 2011 Mike Christie 6.2.0.872-10 +- Fix iscsi init scripts check for networking being up (#692230) * Wed Feb 09 2011 Fedora Release Engineering - 6.2.0.872-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild diff --git a/iscsid.init b/iscsid.init index 2e4ccc5..0adadc7 100755 --- a/iscsid.init +++ b/iscsid.init @@ -93,7 +93,6 @@ stop() { echo -n $"Stopping $prog: " iscsiadm -k 0 2>/dev/null - echo # only remove the iscsi drivers when offload is used rmmod bnx2i 2>/dev/null @@ -106,7 +105,9 @@ stop() { modprobe -r ib_iser 2>/dev/null modprobe -r iscsi_tcp 2>/dev/null + success $"Stopping $prog" rm -f $lockfile + echo return 0 } diff --git a/iscsidevs.init b/iscsidevs.init index ef25a61..ba84a87 100755 --- a/iscsidevs.init +++ b/iscsidevs.init @@ -15,7 +15,9 @@ ### BEGIN INIT INFO # Provides: iscsi # Required-Start: iscsid +# Should-Start: tgtd # Required-Stop: iscsid +# Should-Stop: tgtd # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: Starts and stops login and scanning of iSCSI devices.