[lvm-devel] [PATCH v2] clvmd: supress ENOENT error on testing connection

Eric Ren zren at suse.com
Wed Nov 1 14:35:43 UTC 2017


Hi Zdenek,

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

Thanks,
Eric

On 10/30/2017 08:53 PM, Eric Ren wrote:
> 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.
>
> Signed-off-by: Eric Ren <zren at suse.com>
> ---
>   daemons/clvmd/clvmd.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
> index 9dbda89..fda8f83 100644
> --- a/daemons/clvmd/clvmd.c
> +++ b/daemons/clvmd/clvmd.c
> @@ -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;
>   	}
>   




More information about the lvm-devel mailing list