[stgt] [PATCH] SEM Key Clash with Open-iSCSI initiator and FHS correction for ipc socket

Roland Friedwagner roland.friedwagner at wu.ac.at
Sun Mar 6 17:41:05 CET 2011

From: Roland Friedwagner <rfried at wu.ac.at>

 - Fix logging semaphore key clash between iscsd and tgtd

   iscsd and tgtd both use the same unix ipc key(0xa7) for
   logging semaphore.
   The error messages found before in syslog are:
     tgtd: semop up failed
     iscsid: semop down failed 22

 - IPC namespace socket location moved to /var/run

   Change location from /tmp to /var/run to avoid the socket file
   is accidentally deleted by admins or cron system maintenance scripts.
   I think it is also more FHS conform this way.

Signed-off-by: Roland Friedwagner <rfried at wu.ac.at>

diff -uprN tgt-1.0.14.orig/usr/log.c tgt-1.0.14/usr/log.c
--- tgt-1.0.14.orig/usr/log.c	2011-03-01 12:53:45.000000000 +0100
+++ tgt-1.0.14/usr/log.c	2011-03-03 16:13:53.758746516 +0100
@@ -33,7 +33,7 @@

 #include "log.h"

-#define SEMKEY	0xA7L
+#define SEMKEY	0x54475444L /* TGTD */
 #define LOGDBG 0

diff -uprN tgt-1.0.14.orig/usr/tgtadm.h tgt-1.0.14/usr/tgtadm.h
--- tgt-1.0.14.orig/usr/tgtadm.h	2011-03-01 12:53:45.000000000 +0100
+++ tgt-1.0.14/usr/tgtadm.h	2011-03-03 16:14:01.612496609 +0100
@@ -1,7 +1,7 @@
 #ifndef TGTADM_H
 #define TGTADM_H

+#define TGT_IPC_NAMESPACE	"/var/run/tgtd.ipc_abstract_namespace"
 #define TGT_LLD_NAME_LEN	64

 #define GLOBAL_TID (~0U)

Thx & Kind Regards,
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list