|
Zbigniew Jędrzejewski-Szmek |
399a2a |
From 62ae285fd7265de8ef410b876a8aec047a93ea37 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
Date: Thu, 12 Mar 2015 21:29:28 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
Subject: [PATCH] journal-remote: downgrade routine messages to debug
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
https://bugs.freedesktop.org/show_bug.cgi?id=89486
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
(cherry picked from commit 0e72da6fe8671d49b4d458519f5ac7600fd04f03)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
---
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
src/journal-remote/journal-remote-parse.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
src/journal-remote/journal-remote-write.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
src/journal-remote/journal-remote.c | 36 +++++++++++++++----------------
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
src/journal-remote/microhttpd-util.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
4 files changed, 22 insertions(+), 22 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
index afded7e380..6c096de03a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
--- a/src/journal-remote/journal-remote-parse.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+++ b/src/journal-remote/journal-remote-parse.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -443,7 +443,7 @@ int process_source(RemoteSource *source, bool compress, bool seal) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
/* We have a full event */
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_trace("Received a full event from source@%p fd:%d (%s)",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_trace("Received full event from source@%p fd:%d (%s)",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
source, source->fd, source->name);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (!source->iovw.count) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
index df30049397..99820fa7b8 100644
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
--- a/src/journal-remote/journal-remote-write.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+++ b/src/journal-remote/journal-remote-write.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -156,7 +156,7 @@ int writer_write(Writer *w,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
else
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("%s: Successfully rotated journal", w->journal->path);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("%s: Successfully rotated journal", w->journal->path);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
log_debug("Retrying write.");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
r = journal_file_append_entry(w->journal, ts, iovw->iovec, iovw->count,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
index 8f32a9a988..d1486e7cda 100644
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
--- a/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+++ b/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -207,7 +207,7 @@ static int open_output(Writer *w, const char* host) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
log_error_errno(r, "Failed to open output journal %s: %m",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
output);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
else
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Opened output file %s", w->journal->path);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Opened output file %s", w->journal->path);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
}
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -747,7 +747,7 @@ static int setup_microhttpd_socket(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
const char *trust) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
int fd;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- fd = make_socket_fd(LOG_INFO, address, SOCK_STREAM | SOCK_CLOEXEC);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ fd = make_socket_fd(LOG_DEBUG, address, SOCK_STREAM | SOCK_CLOEXEC);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (fd < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return fd;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -844,7 +844,7 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (n < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return log_error_errno(n, "Failed to read listening file descriptors from environment: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
else
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Received %d descriptors", n);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Received %d descriptors", n);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (MAX(http_socket, https_socket) >= SD_LISTEN_FDS_START + n) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
log_error("Received fewer sockets than expected");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -853,7 +853,7 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (sd_is_socket(fd, AF_UNSPEC, 0, true)) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Received a listening socket (fd:%d)", fd);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Received a listening socket (fd:%d)", fd);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (fd == http_socket)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
r = setup_microhttpd_server(s, fd, NULL, NULL, NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -868,7 +868,7 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return log_error_errno(r, "Failed to retrieve remote name: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Received a connection socket (fd:%d) from %s", fd, hostname);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Received a connection socket (fd:%d) from %s", fd, hostname);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
r = add_source(s, fd, hostname, true);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
} else {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -908,7 +908,7 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
}
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (arg_listen_raw) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Listening on a socket...");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Listening on a socket...");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
r = setup_raw_socket(s, arg_listen_raw);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -930,12 +930,12 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
const char *output_name;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (streq(*file, "-")) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Using standard input as source.");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Using standard input as source.");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
fd = STDIN_FILENO;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
output_name = "stdin";
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
} else {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Reading file %s...", *file);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Reading file %s...", *file);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
fd = open(*file, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NONBLOCK);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (fd < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -1014,22 +1014,22 @@ static int dispatch_raw_source_event(sd_event_source *event,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (source->state == STATE_EOF) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
size_t remaining;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("EOF reached with source fd:%d (%s)",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- source->fd, source->name);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("EOF reached with source fd:%d (%s)",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ source->fd, source->name);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
remaining = source_non_empty(source);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (remaining > 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_warning("Premature EOF. %zu bytes lost.", remaining);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_notice("Premature EOF. %zu bytes lost.", remaining);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
remove_source(s, source->fd);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("%zu active sources remaining", s->active);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("%zu active sources remaining", s->active);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
} else if (r == -E2BIG) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_error("Entry too big, skipped");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_notice_errno(E2BIG, "Entry too big, skipped");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return 1;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
} else if (r == -EAGAIN) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
} else if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info_errno(r, "Closing connection: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug_errno(r, "Closing connection: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
remove_source(server, fd);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
} else
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -1071,10 +1071,10 @@ static int accept_connection(const char* type, int fd,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
}
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Accepted %s %s connection from %s",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- type,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- socket_address_family(addr) == AF_INET ? "IP" : "IPv6",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- a);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Accepted %s %s connection from %s",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ type,
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ socket_address_family(addr) == AF_INET ? "IP" : "IPv6",
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ a);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
*hostname = b;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
index a95fff18f3..b45c38d682 100644
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
--- a/src/journal-remote/microhttpd-util.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+++ b/src/journal-remote/microhttpd-util.c
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -178,7 +178,7 @@ static int verify_cert_authorized(gnutls_session_t session) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return log_error_errno(r, "gnutls_certificate_verification_status_print failed: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Certificate status: %s", out.data);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Certificate status: %s", out.data);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
gnutls_free(out.data);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return status == 0 ? 0 : -EPERM;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
@@ -280,7 +280,7 @@ int check_permissions(struct MHD_Connection *connection, int *code, char **hostn
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
return -EPERM;
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
}
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
- log_info("Connection from %s", buf);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
+ log_debug("Connection from %s", buf);
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
if (hostname) {
|
|
Zbigniew Jędrzejewski-Szmek |
399a2a |
*hostname = buf;
|