[iscsi-initiator-utils: 2/4] Resolves: #963039 #1111925 #1126524

Chris Leech cleech at fedoraproject.org
Fri Oct 24 00:08:16 UTC 2014


commit b34de1dc9c931a2d4bc725241e7a43bdfb8efa9f
Author: Chris Leech <cleech at redhat.com>
Date:   Wed Sep 24 16:34:32 2014 -0700

    Resolves: #963039 #1111925 #1126524
    
    ignore iscsiadm return in iscsi.service
    make sure systemd orders remote unmounts vs iscsi logout
    add discovery as a valid mode in iscsiadm.8

 ...d-discovery-as-a-valid-mode-in-iscsiadm.8.patch |   36 ++++++++++++++
 0152-use-var-for-config.patch                      |   50 ++++++++++----------
 0170-fix-systemd-unit-wants.patch                  |   41 ++++++++++++++++
 iscsi-initiator-utils.spec                         |   28 +++++++++++
 4 files changed, 130 insertions(+), 25 deletions(-)
---
diff --git a/0140-add-discovery-as-a-valid-mode-in-iscsiadm.8.patch b/0140-add-discovery-as-a-valid-mode-in-iscsiadm.8.patch
new file mode 100644
index 0000000..bfff999
--- /dev/null
+++ b/0140-add-discovery-as-a-valid-mode-in-iscsiadm.8.patch
@@ -0,0 +1,36 @@
+From f6e152e735231fe5cb1075b6d1c27ed1b248bdbd Mon Sep 17 00:00:00 2001
+From: Chris Leech <cleech at redhat.com>
+Date: Wed, 24 Sep 2014 15:35:24 -0700
+Subject: [PATCH] add discovery as a valid mode in iscsiadm.8
+
+---
+ doc/iscsiadm.8 | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
+index 9a945d1..05793b2 100644
+--- a/doc/iscsiadm.8
++++ b/doc/iscsiadm.8
+@@ -174,13 +174,13 @@ for session mode).
+ .TP
+ \fB\-m, \-\-mode \fIop\fR
+ specify the mode. \fIop\fR
+-must be one of \fIdiscoverydb\fR, \fInode\fR, \fIfw\fR, \fIhost\fR \fIiface\fR or \fIsession\fR.
++must be one of \fIdiscovery\fR, \fIdiscoverydb\fR, \fInode\fR, \fIfw\fR, \fIhost\fR \fIiface\fR or \fIsession\fR.
+ .IP
+-If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
+-of their respective records are displayed; for \fIsession\fR, all active
+-sessions and connections are displayed; for \fIfw\fR, all boot firmware
+-values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
+-for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
++If no other options are specified: for \fIdiscovery\fR, \fIdiscoverydb\fR and
++\fInode\fR, all of their respective records are displayed; for \fIsession\fR,
++all active sessions and connections are displayed; for \fIfw\fR, all boot
++firmware values are displayed; for \fIhost\fR, all iSCSI hosts are displayed;
++and for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
+ 
+ .TP
+ \fB\-n\fR, \fB\-\-name=\fIname\fR
+-- 
+1.9.3
+
diff --git a/0152-use-var-for-config.patch b/0152-use-var-for-config.patch
index 2e4288c..dc5a73c 100644
--- a/0152-use-var-for-config.patch
+++ b/0152-use-var-for-config.patch
@@ -1,4 +1,4 @@
-From be8702e609fdfd417547f758cb88956066b63023 Mon Sep 17 00:00:00 2001
+From 8c287d6b8c1edf51c2f91878d72822d33aa8348b Mon Sep 17 00:00:00 2001
 From: Chris Leech <cleech at redhat.com>
 Date: Mon, 19 Nov 2012 16:38:45 -0800
 Subject: use var for config
@@ -12,7 +12,7 @@ Subject: use var for config
  5 files changed, 33 insertions(+), 31 deletions(-)
 
 diff --git a/README b/README
-index 90e2074..9cc62ca 100644
+index 0ac4529..e7c7bf5 100644
 --- a/README
 +++ b/README
 @@ -156,8 +156,7 @@ Usage: iscsid [OPTION]
@@ -25,7 +25,7 @@ index 90e2074..9cc62ca 100644
  
  Configuration is contained in directories for:
  
-@@ -467,7 +466,7 @@ a scsi_host per HBA port).
+@@ -475,7 +474,7 @@ a scsi_host per HBA port).
  To manage both types of initiator stacks, iscsiadm uses the interface (iface)
  structure. For each HBA port or for software iscsi for each network
  device (ethX) or NIC, that you wish to bind sessions to you must create
@@ -34,7 +34,7 @@ index 90e2074..9cc62ca 100644
  
  Prep:
  
-@@ -501,29 +500,29 @@ Running:
+@@ -509,29 +508,29 @@ Running:
  iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
  iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
  
@@ -69,7 +69,7 @@ index 90e2074..9cc62ca 100644
  
  iface.transport_name = tcp
  iface.hwaddress = 00:C0:DD:08:63:E7
-@@ -573,7 +572,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
+@@ -581,7 +580,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
  qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty>
  
  
@@ -78,7 +78,7 @@ index 90e2074..9cc62ca 100644
  The format is:
  
  iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
-@@ -659,7 +658,7 @@ need a seperate network connection to the target for discovery purposes.
+@@ -667,7 +666,7 @@ need a seperate network connection to the target for discovery purposes.
  *This will be fixed in the next version of open-iscsi*
  
  For compatibility reasons, when you run iscsiadm to do discovery, it
@@ -87,7 +87,7 @@ index 90e2074..9cc62ca 100644
  tcp for the iface.transport and it will bind the portals that are discovered
  so that they will be logged in through those ifaces. This behavior can also
  be overriden by passing in the interfaces you want to use. For the case
-@@ -677,7 +676,7 @@ we do not bind a session to a iface, then you can use the special iface
+@@ -685,7 +684,7 @@ we do not bind a session to a iface, then you can use the special iface
  
  iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
  
@@ -96,7 +96,7 @@ index 90e2074..9cc62ca 100644
  not pass anything into iscsiadm, running iscsiadm will do the default
  behavior, where we allow the network subsystem to decide which
  device to use.
-@@ -719,7 +718,7 @@ To now log into targets it is the same as with sofware iscsi. See section
+@@ -727,7 +726,7 @@ To now log into targets it is the same as with sofware iscsi. See section
  
  	    ./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
  
@@ -105,7 +105,7 @@ index 90e2074..9cc62ca 100644
  	ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
  	will perform discovery using the settings stored in the record.
  	If a record does not exist, it will be created using the iscsid.conf
-@@ -728,7 +727,7 @@ To now log into targets it is the same as with sofware iscsi. See section
+@@ -736,7 +735,7 @@ To now log into targets it is the same as with sofware iscsi. See section
  	The argument to -p may also be a hostname instead of an address.
  	    ./iscsiadm -m discoverydb -t st -p smoehost --discover
  
@@ -114,7 +114,7 @@ index 90e2074..9cc62ca 100644
  	interfaces using software iscsi. If any are found then nodes found
  	during discovery will be setup so that they can logged in through
  	those interfaces. To specify a specific iface, pass the
-@@ -784,7 +783,7 @@ To now log into targets it is the same as with sofware iscsi. See section
+@@ -792,7 +791,7 @@ To now log into targets it is the same as with sofware iscsi. See section
  	This command will perform discovery, but not manipulate the node DB.
  
    - SendTargets iSCSI Discovery with a specific interface. If you
@@ -123,7 +123,7 @@ index 90e2074..9cc62ca 100644
  	then you can pass them in during discovery:
  
  	     ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-@@ -1145,8 +1144,8 @@ where targetname is the name of the target and ip_address:port is the address
+@@ -1193,8 +1192,8 @@ where targetname is the name of the target and ip_address:port is the address
  and port of the portal. tpgt, is the portal group tag of
  the portal, and is not used in iscsiadm commands except for static
  record creation. And iface name is the name of the iscsi interface
@@ -134,7 +134,7 @@ index 90e2074..9cc62ca 100644
  Default here is iscsi_tcp/tcp to be used over which ever NIC the
  network layer decides is best.
  
-@@ -1261,7 +1260,7 @@ If set, iscsid will perform discovery to the address every
+@@ -1309,7 +1308,7 @@ If set, iscsid will perform discovery to the address every
  discovery.isns.discoveryd_poll_inval or
  discovery.sendtargets.discoveryd_poll_inval seconds,
  and it will log into any portals found from the discovery source using
@@ -144,10 +144,10 @@ index 90e2074..9cc62ca 100644
  Note that for iSNS the poll_interval does not have to be set. If not set,
  iscsid will only perform rediscovery when it gets a SCN from the server.
 diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
-index 6b15fcd..30811bd 100644
+index 05793b2..334520a 100644
 --- a/doc/iscsiadm.8
 +++ b/doc/iscsiadm.8
-@@ -101,7 +101,7 @@ This option is only valid for ping submode.
+@@ -103,7 +103,7 @@ This option is only valid for ping submode.
  .TP
  \fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
  The interface argument specifies the iSCSI interface to use for the operation.
@@ -156,16 +156,16 @@ index 6b15fcd..30811bd 100644
  iSCSI (qla4xxx) the iface config must have the hardware address
  (iface.hwaddress = port's MAC address)
  and the driver/transport_name (iface.transport_name). The iface's name is
-@@ -178,7 +178,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
- of their respective records are displayed; for \fIsession\fR, all active
- sessions and connections are displayed; for \fIfw\fR, all boot firmware
- values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
--for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
-+for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed.
+@@ -180,7 +180,7 @@ If no other options are specified: for \fIdiscovery\fR, \fIdiscoverydb\fR and
+ \fInode\fR, all of their respective records are displayed; for \fIsession\fR,
+ all active sessions and connections are displayed; for \fIfw\fR, all boot
+ firmware values are displayed; for \fIhost\fR, all iSCSI hosts are displayed;
+-and for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
++and for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed.
  
  .TP
  \fB\-n\fR, \fB\-\-name=\fIname\fR
-@@ -562,10 +562,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
+@@ -565,10 +565,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
  The file containing the iSCSI InitiatorName and InitiatorAlias read by
  \fBiscsid\fR and \fBiscsiadm\fR on startup.
  .TP
@@ -179,10 +179,10 @@ index 6b15fcd..30811bd 100644
  
  .SH "SEE ALSO"
 diff --git a/usr/idbm.c b/usr/idbm.c
-index 634e547..4bb9810 100644
+index ce9fb6a..c3c8de5 100644
 --- a/usr/idbm.c
 +++ b/usr/idbm.c
-@@ -2721,9 +2721,9 @@ free_info:
+@@ -2919,9 +2919,9 @@ free_info:
  int idbm_init(idbm_get_config_file_fn *fn)
  {
  	/* make sure root db dir is there */
@@ -196,7 +196,7 @@ index 634e547..4bb9810 100644
  			return errno;
  		}
 diff --git a/usr/idbm.h b/usr/idbm.h
-index 5e4038d..1e9b132 100644
+index b9020fe..b89ddff 100644
 --- a/usr/idbm.h
 +++ b/usr/idbm.h
 @@ -29,12 +29,13 @@
@@ -235,5 +235,5 @@ index 01f7074..f396918 100644
  struct iface_rec;
  struct list_head;
 -- 
-1.8.1.4
+1.9.3
 
diff --git a/0170-fix-systemd-unit-wants.patch b/0170-fix-systemd-unit-wants.patch
new file mode 100644
index 0000000..45ce32a
--- /dev/null
+++ b/0170-fix-systemd-unit-wants.patch
@@ -0,0 +1,41 @@
+From 347e6120213efda47a45443b4e366ed1400433c1 Mon Sep 17 00:00:00 2001
+From: Chris Leech <cleech at redhat.com>
+Date: Wed, 17 Sep 2014 09:58:39 -0700
+Subject: [PATCH] updates to iscsi.service
+
+Resolves: #1126524
+Resolves: #1111925
+---
+ etc/systemd/iscsi.service | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
+index 3de76c5..ad7be34 100644
+--- a/etc/systemd/iscsi.service
++++ b/etc/systemd/iscsi.service
+@@ -5,17 +5,17 @@ DefaultDependencies=no
+ Conflicts=shutdown.target
+ After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service
+ Before=remote-fs-pre.target
++Wants=remote-fs-pre.target
+ ConditionDirectoryNotEmpty=|/var/lib/iscsi/nodes
+ ConditionDirectoryNotEmpty=|/sys/class/iscsi_session
+ 
+ [Service]
+ Type=oneshot
+ RemainAfterExit=true
+-ExecStart=/usr/libexec/iscsi-mark-root-nodes
+-SuccessExitStatus=21
+-ExecStart=/sbin/iscsiadm -m node --loginall=automatic
+-ExecStop=/sbin/iscsiadm -m node --logoutall=automatic
+-ExecReload=/sbin/iscsiadm -m node --loginall=automatic
++ExecStart=-/usr/libexec/iscsi-mark-root-nodes
++ExecStart=-/sbin/iscsiadm -m node --loginall=automatic
++ExecStop=-/sbin/iscsiadm -m node --logoutall=automatic
++ExecReload=-/sbin/iscsiadm -m node --loginall=automatic
+ 
+ [Install]
+ WantedBy=sysinit.target
+-- 
+1.9.3
+
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index ac3cf43..54c5228 100644
--- a/iscsi-initiator-utils.spec
+++ b/iscsi-initiator-utils.spec
@@ -95,6 +95,7 @@ Patch83: 0083-Parse-origin-value-from-iBFT.patch
 Patch84: 0084-isns-Add-docs-for-deregistering-discovery-domains.patch
 
 # not (yet) upstream merged
+Patch140: 0140-add-discovery-as-a-valid-mode-in-iscsiadm.8.patch
 Patch143: 0143-idmb_rec_write-check-for-tpgt-first.patch
 Patch145: 0145-idbm_rec_write-seperate-old-and-new-style-writes.patch
 Patch146: 0146-idbw_rec_write-pick-tpgt-from-existing-record.patch
@@ -119,6 +120,7 @@ Patch166: 0166-start-socket-listeners-on-iscsiadm-command.patch
 Patch167: 0167-Revert-iscsiadm-return-error-when-login-fails.patch
 Patch168: 0168-update-handling-of-boot-sessions.patch
 Patch169: 0169-update-iscsi.service-for-boot-session-recovery.patch
+Patch170: 0170-fix-systemd-unit-wants.patch
 # version string, needs to be updated with each build
 Patch199: 0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch
 
@@ -240,6 +242,7 @@ developing applications that use %{name}.
 %patch83 -p1
 %patch84 -p1
 # pending upstream merge
+%patch140 -p1
 %patch143 -p1
 %patch145 -p1
 %patch146 -p1
@@ -264,6 +267,7 @@ developing applications that use %{name}.
 %patch167 -p1
 %patch168 -p1
 %patch169 -p1
+%patch170 -p1
 # version string
 %patch199 -p1
 
@@ -380,6 +384,27 @@ fi
 /bin/systemctl try-restart iscsid.service >/dev/null 2>&1 || :
 /bin/systemctl try-restart iscsi.service >/dev/null 1>&1 || :
 
+%triggerun -- iscsi-initiator-utils < 6.2.0.873-22
+# prior to 6.2.0.873-22 iscsi.service was missing a Wants=remote-fs-pre.target
+# this forces remote-fs-pre.target active if needed for a clean shutdown/reboot
+# after upgrading this package
+if [ $1 -gt 0 ]; then
+    /usr/bin/systemctl -q is-active iscsi.service
+    if [ $? -eq 0 ]; then
+        /usr/bin/systemctl -q is-active remote-fs-pre.target
+        if [ $? -ne 0 ]; then
+            SRC=`/usr/bin/systemctl show --property FragmentPath remote-fs-pre.target | cut -d= -f2`
+            DST=/run/systemd/system/remote-fs-pre.target
+            if [ $SRC != $DST ]; then
+                cp $SRC $DST
+            fi
+            sed -i 's/RefuseManualStart=yes/RefuseManualStart=no/' $DST
+            /usr/bin/systemctl daemon-reload
+            /usr/bin/systemctl start remote-fs-pre.target
+        fi
+    fi
+fi
+
 %files
 %doc README
 %dir %{_sharedstatedir}/iscsi
@@ -425,6 +450,9 @@ fi
 %changelog
 * Wed Sep 24 2014 Chris Leech <cleech at redhat.com> - 6.2.0.873-22
 - 1081798 retry login on host not found error
+- 1111925 ignore iscsiadm return in iscsi.service
+- 1126524 make sure systemd order against remote mounts is correct
+- 963039 add discovery as a valid mode in iscsiadm.8
 - sync with upstream
 
 * Tue Mar 18 2014 Chris Leech <cleech at redhat.com> - 6.2.0.873-21


More information about the scm-commits mailing list