move lock file from etc to var

This commit is contained in:
mchristi 2006-10-02 23:32:45 +00:00
parent a94a2bb2ce
commit c5776a5889
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,32 @@
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-09-15 12:06:23.000000000 -0500
+++ open-iscsi-6.2.0.695.work/usr/idbm.c 2006-10-02 15:10:42.000000000 -0500
@@ -710,6 +710,13 @@ static int idbm_lock(idbm_t *db)
return 0;
}
+ if (access(LOCK_DIR, F_OK) != 0) {
+ if (mkdir(LOCK_DIR, 0660) != 0) {
+ log_error("Could not open %s. Exiting\n", LOCK_DIR);
+ exit(-1);
+ }
+ }
+
fd = open(LOCK_FILE, O_RDWR | O_CREAT, 0666);
if (fd >= 0)
close(fd);
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-02 15:13:17.000000000 -0500
+++ open-iscsi-6.2.0.695.work/usr/initiator.h 2006-10-02 14:06:15.000000000 -0500
@@ -36,8 +36,9 @@
#define CONFIG_FILE "/etc/iscsi/iscsid.conf"
#define PID_FILE "/var/run/iscsid.pid"
#define INITIATOR_NAME_FILE "/etc/iscsi/initiatorname.iscsi"
-#define LOCK_FILE "/etc/iscsi/lock"
-#define LOCK_WRITE_FILE "/etc/iscsi/lock.write"
+#define LOCK_DIR "/var/lock/iscsi"
+#define LOCK_FILE "/var/lock/iscsi/lock"
+#define LOCK_WRITE_FILE "/var/lock/iscsi/lock.write"
#define DEF_ISCSI_PORT 3260

View File

@ -1,13 +1,14 @@
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.2.0.695
Release: 0.3
Release: 0.4
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
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
Group: System Environment/Daemons
License: GPL
@ -29,6 +30,7 @@ Protocol networks.
%patch1 -p1 -b .add-iscsi-iname
%patch2 -p1 -b .fix-session-mixup-on-restart
%patch3 -p1 -b .use-var-for-pid
%patch4 -p1 -b .use-var-for-lock
%build
make OPTFLAGS="%{optflags}" -C usr
@ -71,6 +73,9 @@ fi
%{_mandir}/*/*
%changelog
* Mon Oct 1 2006 Mike Christie <mchristie@redhat.com> - 6.2.0.695-0.4
- BZ 208548 move /etc/iscsi/lock to /var/lock/iscsi/lock
* Wed Sep 27 2006 Jeremy Katz <katzj@redhat.com> - 6.2.0.695-0.3
- Add fix for initscript with pid file moved