[iscsi-initiator-utils: 28/109] move nodes and sendtargets config dirs to /var/lib/iscsi

Chris Leech cleech at fedoraproject.org
Tue Dec 10 21:21:43 UTC 2013


commit e99cc789528c7c68a9fdecac1d265ddc3e6d3b84
Author: mchristi <mchristi at redhat.com>
Date:   Tue Oct 3 19:51:23 2006 +0000

    move nodes and sendtargets config dirs to /var/lib/iscsi

 iscsi-initiator-utils-use-var-for-config.patch |   78 ++++++++++++++++++++++++
 iscsi-initiator-utils.spec                     |    7 ++-
 2 files changed, 84 insertions(+), 1 deletions(-)
---
diff --git a/iscsi-initiator-utils-use-var-for-config.patch b/iscsi-initiator-utils-use-var-for-config.patch
new file mode 100644
index 0000000..9b739d4
--- /dev/null
+++ b/iscsi-initiator-utils-use-var-for-config.patch
@@ -0,0 +1,78 @@
+diff -aurp open-iscsi-6.2.0.695/usr/idbm.c open-iscsi-6.2.0.695.work/usr/idbm.c
+--- open-iscsi-6.2.0.695/usr/idbm.c	2006-10-03 13:54:51.000000000 -0500
++++ open-iscsi-6.2.0.695.work/usr/idbm.c	2006-10-03 14:44:56.000000000 -0500
+@@ -831,10 +831,18 @@ idbm_node_write(idbm_t *db, node_rec_t *
+ 
+ 	idbm_lock(db);
+ 
+-	snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR);
+-	if (access(portal, F_OK) != 0) {
++	/* bah: there has to be a function to make all these subdirs for us */
++	if (access(CONFIG_DIR, F_OK) != 0) {
+ 		if (mkdir(portal, 0660) != 0) {
+-			log_error("Could not make %s\n", portal);
++			log_error("Could not make %s %d\n", CONFIG_DIR, errno);
++			rc = errno;
++			goto free_portal;
++		}
++	}
++
++	if (access(NODE_CONFIG_DIR, F_OK) != 0) {
++		if (mkdir(NODE_CONFIG_DIR, 0660) != 0) {
++			log_error("Could not make %s\n", NODE_CONFIG_DIR);
+ 			rc = errno;
+ 			goto free_portal;
+ 		}
+@@ -869,6 +877,7 @@ free_portal:
+ 	return rc;
+ }
+ 
++/* TODO: merged these two functions */
+ static int
+ idbm_discovery_write(idbm_t *db, discovery_rec_t *rec)
+ {
+@@ -883,10 +892,18 @@ idbm_discovery_write(idbm_t *db, discove
+ 	}
+ 
+ 	idbm_lock(db);
+-	snprintf(portal, PATH_MAX, "%s", ST_CONFIG_DIR);
+-	if (access(portal, F_OK) != 0) {
+-		if (mkdir(portal, 0660) != 0) {
+-			log_error("Could not make %s\n", portal);
++
++	if (access(CONFIG_DIR, F_OK) != 0) {
++		if (mkdir(CONFIG_DIR, 0660) != 0) {
++			log_error("Could not make %s %d\n", CONFIG_DIR, errno);
++			rc = errno;
++			goto free_portal;
++		}
++	}
++
++	if (access(ST_CONFIG_DIR, F_OK) != 0) {
++		if (mkdir(ST_CONFIG_DIR, 0660) != 0) {
++			log_error("Could not make %s\n", ST_CONFIG_DIR);
+ 			rc = errno;
+ 			goto free_portal;
+ 		}
+diff -aurp open-iscsi-6.2.0.695/usr/initiator.h open-iscsi-6.2.0.695.work/usr/initiator.h
+--- open-iscsi-6.2.0.695/usr/initiator.h	2006-10-03 13:54:51.000000000 -0500
++++ open-iscsi-6.2.0.695.work/usr/initiator.h	2006-10-03 14:08:09.000000000 -0500
+@@ -31,11 +31,15 @@
+ #include "actor.h"
+ #include "queue.h"
+ 
+-#define ST_CONFIG_DIR		"/etc/iscsi/send_targets"
+-#define NODE_CONFIG_DIR		"/etc/iscsi/nodes"
++#define CONFIG_DIR		"/var/lib/iscsi"
++#define ST_CONFIG_DIR		"/var/lib/iscsi/send_targets"
++#define NODE_CONFIG_DIR		"/var/lib/iscsi/nodes"
++
+ #define CONFIG_FILE		"/etc/iscsi/iscsid.conf"
+-#define PID_FILE		"/var/run/iscsid.pid"
+ #define INITIATOR_NAME_FILE	"/etc/iscsi/initiatorname.iscsi"
++
++#define PID_FILE		"/var/run/iscsid.pid"
++
+ #define LOCK_DIR		"/var/lock/iscsi"
+ #define LOCK_FILE		"/var/lock/iscsi/lock"
+ #define LOCK_WRITE_FILE		"/var/lock/iscsi/lock.write"
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index efd8287..baa1c83 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.695
-Release: 0.4
+Release: 0.5
 Source0: http://people.redhat.com/mchristi/iscsi/FC6/open-iscsi/rpm/open-iscsi-6.2.0.695.tar.bz2
 Source1: iscsi.init
 Patch0: open-iscsi-5.0.5.595-update-initscripts-and-docs.patch
@@ -9,6 +9,7 @@ Patch1: open-iscsi-5.0.5.595-add-iscsi-iname.patch
 Patch2: iscsi-initiator-utils-fix-session-mixup-on-restart.patch
 Patch3: iscsi-initiator-utils-use-var-for-pid.patch
 Patch4: iscsi-initiator-utils-use-var-for-lock.patch
+Patch5: iscsi-initiator-utils-use-var-for-config.patch
 
 Group: System Environment/Daemons
 License: GPL
@@ -31,6 +32,7 @@ Protocol networks.
 %patch2 -p1 -b .fix-session-mixup-on-restart
 %patch3 -p1 -b .use-var-for-pid
 %patch4 -p1 -b .use-var-for-lock
+%patch5 -p1 -b .use-var-for-config
 
 %build
 make OPTFLAGS="%{optflags}" -C usr
@@ -73,6 +75,9 @@ fi
 %{_mandir}/*/*
 
 %changelog
+* Tue Oct 3 2006 Mike Christie <mchristie at redhat.com> - 6.2.0.695-0.5
+- BZ 208864 move /etc/iscsi/nodes and send_targets to /var/lib/iscsi
+
 * Mon Oct 1 2006 Mike Christie <mchristie at redhat.com> - 6.2.0.695-0.4
 - BZ 208548 move /etc/iscsi/lock to /var/lock/iscsi/lock
 


More information about the scm-commits mailing list