From d5aee5e9a5fc2910b0b7cfb8c5fe726ba665178b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 24 Feb 2015 11:11:17 -0500 Subject: [PATCH 1/2] changes file for ticket 14950 --- changes/bug14950 | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changes/bug14950 diff --git a/changes/bug14950 b/changes/bug14950 new file mode 100644 index 0000000000..33cea9cb58 --- /dev/null +++ b/changes/bug14950 @@ -0,0 +1,3 @@ + o Minor features (logs): + - Quiet some log messages in the heartbeat and at startup. Closes + ticket 14950. \ No newline at end of file From 783a44f9e98953e3359fd5ccc1788d993808fa64 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 24 Feb 2015 11:11:24 -0500 Subject: [PATCH 2/2] Log less/better about systemd at startup Report errors if the notification fails; report success only if it succeeds; and if we are not notifying systemd because we aren't running with systemd, don't log at notice. --- src/or/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/or/main.c b/src/or/main.c index 2ef7a7482e..bc89458e87 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -2071,8 +2071,17 @@ do_main_loop(void) #endif #ifdef HAVE_SYSTEMD - log_notice(LD_GENERAL, "Signaling readiness to systemd"); - sd_notify(0, "READY=1"); + { + const int r = sd_notify(0, "READY=1"); + if (r < 0) { + log_warn(LD_GENERAL, "Unable to send readiness to systemd: %s", + strerror(r)); + } else if (r > 0) { + log_notice(LD_GENERAL, "Signaled readiness to systemd"); + } else { + log_info(LD_GENERAL, "Systemd NOTIFY_SOCKET not present."); + } + } #endif for (;;) {