1
0
mirror of https://github.com/systemd/systemd synced 2026-03-13 16:44:48 +01:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Yu Watanabe
1f3b407307 daemon-util: downgrade log level on ECONNREFUSED and friends
This partially reverts 36c557f7d41441bbd98a8965348dfe8050fc9c98, which
introduced notify_remove_fd() that logs in LOG_DEBUG. However,
notify_remove_fd_warn() is still called other library functions, e.g.
notify_push_fd(), and produces warning message about the failure in
removing fd from fdstore on shutdown.

During shutdown process, we get the following logs:
```
systemd-udevd[370]: Failed to send notify message to '/run/systemd/notify': Connection refused
systemd-udevd[370]: Failed to remove file descriptor "config-serialization" from the store, ignoring: Connection refused
systemd-udevd[370]: Failed to send notify message to '/run/systemd/notify': Connection refused
systemd-udevd[370]: Failed to push serialization fd to service manager: Connection refused
```
Here, the 1st, 3rd, and 4th messages are in LOG_DEBUG, but the 2nd one
was in LOG_WARNING before this commit, and this makes it also in LOG_DEBUG.

Follow-up for 472404aca5357b7e65cdddf418342070b0ccd4d2.
2026-02-07 00:15:33 +01:00
Nick Rosbrook
e28958315f resolvectl: include ifindex when printing link-local DNS server
Historically, resolvectl status has not included the interface
specification for DNS servers with an IPv6 link-local address, since it
is technically somewhat redundant. But, adding this extra bit of
information makes it easier to copy-and-paste to use elsewhere, etc.

For example, the previous output:

 Link 2 (enp34s0)
     Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
          Protocols: +DefaultRoute LLMNR=resolve -mDNS -DNSOverTLS DNSSEC=no/unsupported
 Current DNS Server: fe80::861e:a3ff:feb1:f8e7
        DNS Servers: 192.168.1.12 192.168.1.13 fe80::861e:a3ff:feb1:f8e7
         DNS Domain: lan

now becomes:

 Link 2 (enp34s0)
     Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
          Protocols: +DefaultRoute LLMNR=resolve -mDNS -DNSOverTLS DNSSEC=no/unsupported
 Current DNS Server: fe80::861e:a3ff:feb1:f8e7%2
        DNS Servers: 192.168.1.12 192.168.1.13 fe80::861e:a3ff:feb1:f8e7%2
         DNS Domain: lan
2026-02-07 00:14:37 +01:00
4 changed files with 6 additions and 15 deletions

View File

@ -1584,14 +1584,13 @@ static int varlink_dump_dns_configuration(sd_json_variant **ret) {
}
static int format_dns_server_one(DNSConfiguration *configuration, DNSServer *s, char **ret) {
bool global, with_ifindex;
bool global;
int r;
assert(s);
assert(ret);
global = !(configuration->ifindex > 0 || configuration->delegate);
with_ifindex = configuration->ifindex <= 0;
if (global && s->ifindex > 0 && s->ifindex != LOOPBACK_IFINDEX) {
/* This one has an (non-loopback) ifindex set, and we were told to suppress those. Hence do so. */
@ -1603,7 +1602,7 @@ static int format_dns_server_one(DNSConfiguration *configuration, DNSServer *s,
s->family,
&s->in_addr,
s->port != 53 ? s->port : 0,
with_ifindex ? s->ifindex : 0,
s->ifindex,
s->server_name,
ret);
if (r < 0)

View File

@ -4,12 +4,13 @@
#include "alloc-util.h"
#include "daemon-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "log.h"
#include "string-util.h"
#include "time-util.h"
static int notify_remove_fd_full(int log_level, const char *name) {
int notify_remove_fd_warn(const char *name) {
int r;
assert(name);
@ -19,21 +20,13 @@ static int notify_remove_fd_full(int log_level, const char *name) {
"FDNAME=%s", name);
if (r < 0)
return log_full_errno(
log_level, r,
ERRNO_IS_NEG_DISCONNECT(r) ? LOG_DEBUG : LOG_WARNING, r,
"Failed to remove file descriptor \"%s\" from the store, ignoring: %m",
name);
return 0;
}
int notify_remove_fd(const char *name) {
return notify_remove_fd_full(LOG_DEBUG, name);
}
int notify_remove_fd_warn(const char *name) {
return notify_remove_fd_full(LOG_WARNING, name);
}
int notify_remove_fd_warnf(const char *format, ...) {
_cleanup_free_ char *p = NULL;
va_list ap;

View File

@ -21,7 +21,6 @@ static inline void notify_on_cleanup(const char **p) {
(void) sd_notify(false, *p);
}
int notify_remove_fd(const char *name);
int notify_remove_fd_warn(const char *name);
int notify_remove_fd_warnf(const char *format, ...) _printf_(1, 2);
int close_and_notify_warn(int fd, const char *name);

View File

@ -1529,7 +1529,7 @@ int manager_main(Manager *manager) {
/* We will start processing events in the loop below. Before starting processing, let's remove the
* event serialization fd from the fdstore, to avoid retrieving the serialized events again in future
* invocations. Otherwise, the serialized events may be processed multiple times. */
(void) notify_remove_fd("event-serialization");
(void) notify_remove_fd_warn("event-serialization");
r = sd_event_loop(manager->event);
if (r < 0)