diff options
author | Eric Ren <zren@suse.com> | 2017-10-30 20:53:20 +0800 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2017-11-07 21:24:39 +0100 |
commit | 14d0b0bbddb214fbb5dcacfb60d1723d87076bd9 (patch) | |
tree | bce2e2ef2c3c679225edbae0ef631bc5aea8a91a | |
parent | 014122256b50b30324fc848fa79492124bebeb39 (diff) | |
download | lvm2-14d0b0bbddb214fbb5dcacfb60d1723d87076bd9.tar.gz |
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.
TODO: add missing error reaction code - since ofter log_error, program
is not supposed to continue running (log_error() is for reporting
stopping problems).
Signed-off-by: Eric Ren <zren@suse.com>
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | daemons/clvmd/clvmd.c | 14 |
2 files changed, 14 insertions, 1 deletions
@@ -1,5 +1,6 @@ Version 2.02.177 - ==================================== + Do not print error when clvmd cannot find running clvmd. Prevent start of new merge of snapshot if origin is already being merged. Version 2.02.176 - 3rd November 2017 diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index 9dbda89cc..e15a40a6d 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -2151,6 +2151,14 @@ static int add_to_lvmqueue(struct local_client *client, struct clvm_header *msg, } /* Return 0 if we can talk to an existing clvmd */ +/* + * FIXME: + * + * This function returns only -1 or 0, but there are + * different levels of errors, some of them should stop + * further execution of clvmd thus another state is needed + * and some error message need to be only informational. + */ static int check_local_clvmd(void) { int local_socket; @@ -2170,7 +2178,11 @@ static int check_local_clvmd(void) if (connect(local_socket,(struct sockaddr *) &sockaddr, sizeof(sockaddr))) { - log_sys_error("connect", "local socket"); + /* connection failure is expected state */ + if (errno == ENOENT) + log_sys_debug("connect", "local socket"); + else + log_sys_error("connect", "local socket"); ret = -1; } |