iscsi-initiator-utils/iscsi-initiator-utils-idbm-lock-error-handling.patch
Hans de Goede a4c8b301eb - Rewrite SysV initscripts, fixes rh 441290, 246960, 282001, 436175, 430791
- Add patch to make iscsiadm complain and exit when run as user instead of
    hang spinning for the database lock
- Add patch to make iscsiadm start iscsid when needed (rh 436175 related)
- Don't start iscsi service when network not yet up (in case of using NM)
    add NM dispatcher script to start iscsi service once network is up
2008-09-30 12:21:47 +00:00

19 lines
614 B
Diff

diff -up open-iscsi-2.0-870-rc1/usr/idbm.c~ open-iscsi-2.0-870-rc1/usr/idbm.c
--- open-iscsi-2.0-870-rc1/usr/idbm.c~ 2008-09-29 13:01:48.000000000 +0200
+++ open-iscsi-2.0-870-rc1/usr/idbm.c 2008-09-29 13:01:48.000000000 +0200
@@ -849,6 +849,14 @@ int idbm_lock(void)
ret = link(LOCK_FILE, LOCK_WRITE_FILE);
if (ret == 0)
break;
+
+ if (errno != EEXIST) {
+ log_error("Could not lock discovery DB: %s: %s",
+ LOCK_WRITE_FILE, strerror(errno));
+ log_error("Maybe you are not root?");
+ exit(-1);
+ } else if (i == 0)
+ log_warning("Waiting for discovery DB lock");
usleep(10000);
}