iscsi-initiator-utils/0006-use-var-for-config.patch

256 lines
10 KiB
Diff
Raw Normal View History

2019-11-19 00:43:15 +00:00
From 9cae86dd15bf78ee9d221f722f723062eb6ad3d8 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:38:45 -0800
2019-11-19 00:43:15 +00:00
Subject: [PATCH] use var for config
---
README | 33 ++++++++++++++++-----------------
doc/iscsiadm.8 | 8 ++++----
2019-11-19 00:43:15 +00:00
doc/iscsid.8 | 2 +-
usr/idbm.c | 6 +++---
usr/idbm.h | 13 +++++++------
2018-05-25 15:15:09 +00:00
usr/iface.h | 3 ++-
2019-11-19 00:43:15 +00:00
6 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/README b/README
2019-11-19 00:43:15 +00:00
index c05814a..326c3b0 100644
--- a/README
+++ b/README
2018-05-25 15:15:09 +00:00
@@ -172,8 +172,7 @@ Usage: iscsid [OPTION]
Open-iSCSI persistent configuration is stored in a number of
directories under a configuration root directory, using a flat-file
-format. This configuration root directory is /etc/iscsi by default,
-but may also commonly be in /var/lib/iscsi.
+format. This configuration root directory is /var/lib/iscsi by default.
Configuration is contained in directories for:
2018-05-25 15:15:09 +00:00
@@ -561,7 +560,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
-a iface config /etc/iscsi/ifaces.
+a iface config /var/lib/iscsi/ifaces.
2018-05-25 15:15:09 +00:00
Prep
----
@@ -594,7 +593,7 @@ Running
The command
iscsiadm -m iface
2010-05-06 21:41:12 +00:00
2018-05-25 15:15:09 +00:00
-will report iface configurations that are setup in /etc/iscsi/ifaces:
+will report iface configurations that are setup in /var/lib/iscsi/ifaces:
2018-05-25 15:15:09 +00:00
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
@@ -604,10 +603,10 @@ The format is:
For software iscsi, you can create the iface configs by hand, but it is
2017-02-09 22:40:49 +00:00
recommended that you use iscsiadm's iface mode. There is an iface.example in
-/etc/iscsi/ifaces which can be used as a template for the daring.
+/var/lib/iscsi/ifaces which can be used as a template for the daring.
2018-05-25 15:15:09 +00:00
For each network object you wish to bind a session to, you must create
2017-02-09 22:40:49 +00:00
-a separate iface config in /etc/iscsi/ifaces and each iface config file
+a separate iface config in /var/lib/iscsi/ifaces and each iface config file
must have a unique name which is less than or equal to 64 characters.
2018-05-25 15:15:09 +00:00
Example
@@ -615,12 +614,12 @@ Example
If you have NIC1 with MAC address 00:0F:1F:92:6B:BF and NIC2 with
2018-05-25 15:15:09 +00:00
MAC address 00:C0:DD:08:63:E7, and you wanted to do software iscsi over
-TCP/IP, then in /etc/iscsi/ifaces/iface0 you would enter:
+TCP/IP, then in /var/lib/iscsi/ifaces/iface0 you would enter:
2018-05-25 15:15:09 +00:00
iface.transport_name = tcp
iface.hwaddress = 00:0F:1F:92:6B:BF
-and in /etc/iscsi/ifaces/iface1 you would enter:
+and in /var/lib/iscsi/ifaces/iface1 you would enter:
2018-05-25 15:15:09 +00:00
iface.transport_name = tcp
iface.hwaddress = 00:C0:DD:08:63:E7
@@ -662,7 +661,7 @@ port. The iface name will be of the form:
Running the following command:
iscsiadm -m iface
2010-05-06 21:41:12 +00:00
2018-05-25 15:15:09 +00:00
-will report iface configurations that are setup in /etc/iscsi/ifaces:
+will report iface configurations that are setup in /var/lib/iscsi/ifaces:
2018-05-25 15:15:09 +00:00
default tcp,<empty>,<empty>,<empty>,<empty>
iser iser,<empty>,<empty>,<empty>,<empty>
@@ -742,7 +741,7 @@ need a separate network connection to the target for discovery purposes.
2010-05-06 21:41:12 +00:00
*This will be fixed in the next version of open-iscsi*
For compatibility reasons, when you run iscsiadm to do discovery, it
-will check for interfaces in /etc/iscsi/iscsi/ifaces that are using
2018-05-25 15:15:09 +00:00
+will check for interfaces in /var/lib/iscsi/iscsi/ifaces that are using
tcp for the iface.transport, and it will bind the portals that are discovered
2010-05-06 21:41:12 +00:00
so that they will be logged in through those ifaces. This behavior can also
2018-05-25 15:15:09 +00:00
be overridden by passing in the interfaces you want to use. For the case
@@ -757,7 +756,7 @@ If you had defined interfaces but wanted the old behavior, where we do not
bind a session to an iface, then you can use the special iface "default":
iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
-And if you did not define any interfaces in /etc/iscsi/ifaces and do
+And if you did not define any interfaces in /var/lib/iscsi/ifaces and do
not pass anything into iscsiadm, running iscsiadm will do the default
2018-05-25 15:15:09 +00:00
behavior, allowing the network subsystem to decide which device to use.
2010-07-12 19:10:19 +00:00
2018-05-25 15:15:09 +00:00
@@ -793,7 +792,7 @@ Discovery mode
ID [192.168.1.1:3260]:
iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
2010-07-12 19:10:19 +00:00
- This will search /etc/iscsi/send_targets for a record with the
+ This will search /var/lib/iscsi/send_targets for a record with the
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
2018-05-25 15:15:09 +00:00
@@ -802,7 +801,7 @@ Discovery mode
The argument to -p may also be a hostname instead of an address:
iscsiadm -m discoverydb -t st -p somehost --discover
2010-07-12 19:10:19 +00:00
- For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for
+ For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for
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
2018-05-25 15:15:09 +00:00
@@ -853,7 +852,7 @@ Discovery mode
2018-05-25 15:15:09 +00:00
- SendTargets iSCSI Discovery with a specific interface.
If you wish to only use a subset of the interfaces in
- /etc/iscsi/ifaces, then you can pass them in during discovery:
+ /var/lib/iscsi/ifaces, then you can pass them in during discovery:
iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
--interface=iface0 --interface=iface1 --discover
2018-05-25 15:15:09 +00:00
@@ -1223,8 +1222,8 @@ where targetname is the name of the target and ip_address:port is the address
and port of the portal. tpgt is the Target Portal Group Tag of
the portal, and is not used in iscsiadm commands except for static
2018-05-25 15:15:09 +00:00
record creation. ifacename is the name of the iscsi interface
-defined in /etc/iscsi/ifaces. If no interface was defined in
-/etc/iscsi/ifaces or passed in, the default behavior is used.
+defined in /var/lib/iscsi/ifaces. If no interface was defined in
+/var/lib/iscsi/ifaces or passed in, the default behavior is used.
2018-05-25 15:15:09 +00:00
Default here is iscsi_tcp/tcp to be used over whichever NIC the
network layer decides is best.
2018-05-25 15:15:09 +00:00
@@ -1336,7 +1335,7 @@ If set, iscsid will perform discovery to the address every
2010-07-12 19:10:19 +00:00
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
-the ifaces in /etc/iscsi/ifaces.
+the ifaces in /var/lib/iscsi/ifaces.
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
2019-11-19 00:43:15 +00:00
index bf23dd2..9cfce16 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
2019-11-19 00:43:15 +00:00
@@ -228,7 +228,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.
-iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware
+iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware
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
2019-11-19 00:43:15 +00:00
@@ -301,7 +301,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
2019-11-19 00:43:15 +00:00
In node mode, specify a field \fIname\fR in a record. In flashnode submode
@@ -640,10 +640,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
-/etc/iscsi/nodes/
+/var/lib/iscsi/nodes/
This directory contains the nodes with their targets.
.TP
-/etc/iscsi/send_targets
+/var/lib/iscsi/send_targets
This directory contains the portals.
2019-11-19 00:43:15 +00:00
.SH "SEE ALSO"
.BR iscsid (8)
diff --git a/doc/iscsid.8 b/doc/iscsid.8
index 6f9218f..0da0551 100644
--- a/doc/iscsid.8
+++ b/doc/iscsid.8
@@ -65,7 +65,7 @@ and
.B iscsiadm
on startup.
.TP
-/etc/iscsi/nodes
+/var/lib/iscsi/nodes
Open-iSCSI persistent configuration database
.SH "SEE ALSO"
diff --git a/usr/idbm.c b/usr/idbm.c
2019-11-19 00:43:15 +00:00
index aed08f2..15802c3 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
2019-11-19 00:43:15 +00:00
@@ -2968,9 +2968,9 @@ free_info:
int idbm_init(idbm_get_config_file_fn *fn)
{
/* make sure root db dir is there */
- if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) {
- if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) {
- log_error("Could not make %s %d", ISCSI_CONFIG_ROOT,
+ if (access(ISCSIVAR, F_OK) != 0) {
+ if (mkdir(ISCSIVAR, 0660) != 0) {
+ log_error("Could not make %s %d", ISCSIVAR,
errno);
return errno;
}
diff --git a/usr/idbm.h b/usr/idbm.h
2019-11-19 00:43:15 +00:00
index 18c5025..6bdfd60 100644
--- a/usr/idbm.h
+++ b/usr/idbm.h
2019-11-19 00:43:15 +00:00
@@ -30,12 +30,13 @@
#include "list.h"
#include "flashnode.h"
-#define NODE_CONFIG_DIR ISCSI_CONFIG_ROOT"nodes"
-#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp"
-#define ISNS_CONFIG_DIR ISCSI_CONFIG_ROOT"isns"
-#define STATIC_CONFIG_DIR ISCSI_CONFIG_ROOT"static"
2010-05-06 21:41:12 +00:00
-#define FW_CONFIG_DIR ISCSI_CONFIG_ROOT"fw"
-#define ST_CONFIG_DIR ISCSI_CONFIG_ROOT"send_targets"
+#define ISCSIVAR "/var/lib/iscsi/"
+#define NODE_CONFIG_DIR ISCSIVAR"nodes"
+#define SLP_CONFIG_DIR ISCSIVAR"slp"
+#define ISNS_CONFIG_DIR ISCSIVAR"isns"
+#define STATIC_CONFIG_DIR ISCSIVAR"static"
2010-05-06 21:41:12 +00:00
+#define FW_CONFIG_DIR ISCSIVAR"fw"
+#define ST_CONFIG_DIR ISCSIVAR"send_targets"
#define ST_CONFIG_NAME "st_config"
2010-07-12 19:10:19 +00:00
#define ISNS_CONFIG_NAME "isns_config"
diff --git a/usr/iface.h b/usr/iface.h
2019-11-19 00:43:15 +00:00
index 6c06f7f..c8b9de9 100644
--- a/usr/iface.h
+++ b/usr/iface.h
2018-05-25 15:15:09 +00:00
@@ -21,8 +21,9 @@
#define ISCSI_IFACE_H
2018-05-25 15:15:09 +00:00
#include <libopeniscsiusr/libopeniscsiusr.h>
2010-05-06 21:41:12 +00:00
+#include "idbm.h"
2018-05-25 15:15:09 +00:00
-#define IFACE_CONFIG_DIR ISCSI_CONFIG_ROOT"ifaces"
2010-05-06 21:41:12 +00:00
+#define IFACE_CONFIG_DIR ISCSIVAR"ifaces"
struct iface_rec;
struct list_head;
--
2019-11-19 00:43:15 +00:00
2.21.0