Skip to contentSkip to conversation

clvmd: supress ENOENT error on testing connection

PATCH Superseded Eric Ren 1 participant 2 messages Oct 30, 2017 – Nov 1, 2017

lore
Share & tools
lore

Eric Ren

author
#0 lore raw

PATCH v2 1/1 clvmd: supress ENOENT error on testing connection

In HA cluster, we have "clvm" resource agent to manage clvmd daemon. The agent invokes clvmd like: "clvmd -T90 -d0", which always prints a scaring error message:

"""
local socket: connect failed: No such file or directory """

When specifed with "-d" option, clvmd tries to check if an instance of the clvmd daemon is already running through a testing connection. The connect() will fail with this ENOENT error in such case, so supress the error message in such case.

---
 daemons/clvmd/clvmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
daemons/clvmd/clvmd.c +2 -1
index 9dbda89..fda8f83 100644
@@ -2170,7 +2170,8 @@ static int check_local_clvmd(void)
 
 	if (connect(local_socket,(struct sockaddr *) &sockaddr,
 		    sizeof(sockaddr))) {
-		log_sys_error("connect", "local socket");
+		if (errno != ENOENT)
+			log_sys_error("connect", "local socket");
 		ret = -1;
 	}
 
Signature · 1 line
2.10.2
author
#1 lore raw

PATCH v2 1/1 clvmd: supress ENOENT error on testing connection

Hi Zdenek,

Please take another look at this simple fix. Is this good for merging?

Thanks,
Eric

Quoted 32 lines · Eric Ren

In HA cluster, we have "clvm" resource agent to manage clvmd daemon. The agent invokes clvmd like: "clvmd -T90 -d0", which always prints a scaring error message:

"""
local socket: connect failed: No such file or directory """

When specifed with "-d" option, clvmd tries to check if an instance of the clvmd daemon is already running through a testing connection. The connect() will fail with this ENOENT error in such case, so supress the error message in such case.

---
  daemons/clvmd/clvmd.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
daemons/clvmd/clvmd.c +2 -1
index 9dbda89..fda8f83 100644
@@ -2170,7 +2170,8 @@ static int check_local_clvmd(void)
 
  	if (connect(local_socket,(struct sockaddr *) &sockaddr,
  		    sizeof(sockaddr))) {
-		log_sys_error("connect", "local socket");
+		if (errno != ENOENT)
+			log_sys_error("connect", "local socket");
  		ret = -1;
  	}