From: Michael Smith Date: Tue, 22 Jun 2021 02:33:47 +0000 (-0400) Subject: unix-socket: Avoid spurious logs on close X-Git-Tag: suricata-7.0.0-beta1~1506 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a64783b3e2f7f1a58050ca5f8d7f85c2a16a9c0a;p=thirdparty%2Fsuricata.git unix-socket: Avoid spurious logs on close Avoid spurious logs when suricatasc closes connection. Use SCLogDebug for control connection EOF, and SCLogError for an error. As Chandan Chowdhury described in redmine 3685. This makes the logging consistent with the older `if (client->version <= UNIX_PROTO_V1)` block about 20 lines above, and avoids polluting the logs with `Unix socket: lost connection with client`. --- diff --git a/src/unix-manager.c b/src/unix-manager.c index 4661bb14f9..9213039db9 100644 --- a/src/unix-manager.c +++ b/src/unix-manager.c @@ -572,9 +572,9 @@ static void UnixCommandRun(UnixCommand * this, UnixClient *client) do { if (ret <= 0) { if (ret == 0) { - SCLogInfo("Unix socket: lost connection with client"); + SCLogDebug("Unix socket: lost connection with client"); } else { - SCLogInfo("Unix socket: error on recv() from client: %s", + SCLogError(SC_ERR_SOCKET, "Unix socket: error on recv() from client: %s", strerror(errno)); } UnixCommandClose(this, client->fd);