summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-15 20:16:40 +0000
committeralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-15 20:16:40 +0000
commit2c588e4eb27d43d8a0fe2ee19319a131f6454b4f (patch)
tree3fa3b994006f35c9161f54b291bcdac3f8a03f51 /src
parent99b5f5809d93f3fccf0553db7c156b781826f10b (diff)
downloadzabbix-2c588e4eb27d43d8a0fe2ee19319a131f6454b4f.tar.gz
zabbix-2c588e4eb27d43d8a0fe2ee19319a131f6454b4f.tar.xz
zabbix-2c588e4eb27d43d8a0fe2ee19319a131f6454b4f.zip
- [ZBX-133] added more debug information on semaphore related errors (Alexei)
[svn merge -r5051:5054 svn://svn.zabbix.com/branches/1.4] git-svn-id: svn://svn.zabbix.com/trunk@5055 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/libs/zbxsys/mutexs.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/libs/zbxsys/mutexs.c b/src/libs/zbxsys/mutexs.c
index 3dad8443..df859d2a 100644
--- a/src/libs/zbxsys/mutexs.c
+++ b/src/libs/zbxsys/mutexs.c
@@ -114,16 +114,24 @@ lbl_create:
}
else if(errno == EEXIST)
{
- zabbix_log(LOG_LEVEL_DEBUG, "ZABBIX semaphores already exists, trying to recreate.");
+ zabbix_log(LOG_LEVEL_WARNING, "ZABBIX semaphores already exist, trying to recreate.");
ZBX_SEM_LIST_ID = semget(sem_key, 0 /* get reference */, 0666 /* 0022 */);
if(forced) {
- semctl(ZBX_SEM_LIST_ID, 0, IPC_RMID, 0);
+ if( 0 != semctl(ZBX_SEM_LIST_ID, 0, IPC_RMID, 0))
+ {
+ zabbix_log(LOG_LEVEL_CRIT, "Can't recreate ZABBIX semaphores for IPC key 0x%lx Semaphore ID %ld. %s.",
+ sem_key,
+ ZBX_SEM_LIST_ID,
+ strerror(errno));
+ exit(1);
+ }
if ( ++attempts > ZBX_MAX_ATTEMPTS )
{
- zabbix_log(LOG_LEVEL_CRIT, "Can't recreate ZABBIX semaphores. [too many attempts]");
+ zabbix_log(LOG_LEVEL_CRIT, "Can't recreate ZABBIX semaphores for IPC key 0x%lx. [too many attempts]",
+ sem_key);
exit(1);
}
if ( attempts > (ZBX_MAX_ATTEMPTS / 2) )
@@ -140,7 +148,9 @@ lbl_create:
{
if( -1 == semctl(ZBX_SEM_LIST_ID, 0, IPC_STAT, semopts))
{
- zbx_error("Semaphore [%i] error in semctl(IPC_STAT)", name);
+ zbx_error("Semaphore [%i] error in semctl(IPC_STAT). %s.",
+ name,
+ strerror(errno));
break;
}
if(semopts.buf->sem_otime !=0 ) goto lbl_return;