]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync: downgrade log level about network configuration change
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 5 Sep 2024 11:08:24 +0000 (20:08 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 6 Sep 2024 01:20:48 +0000 (10:20 +0900)
These message may be unnecessarily shown multiple times when e.g.
networkd is restarted, system is wakeup from suspend, and so on.

Closes #34262.

src/timesync/timesyncd-manager.c

index 5f16ed2b9480d361efb22de6f1ee9f4558b65bbb..32eee91a279aaab809f9a598018575022dbf6b5a 100644 (file)
@@ -1052,11 +1052,15 @@ static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t re
         connected = manager_is_connected(m);
 
         if (connected && !online) {
-                log_info("No network connectivity, watching for changes.");
+                /* When m->talking is false, we have not received any responses from the server,
+                 * and it is not necessary to log about disconnection. */
+                log_full(m->talking ? LOG_INFO : LOG_DEBUG,
+                         "No network connectivity, watching for changes.");
                 manager_disconnect(m);
 
         } else if ((!connected || changed) && online) {
-                log_info("Network configuration changed, trying to establish connection.");
+                log_full(connected ? LOG_DEBUG : LOG_INFO,
+                         "Network configuration changed, trying to establish connection.");
 
                 if (m->current_server_address)
                         r = manager_begin(m);