resolve: always read /etc/resolv.conf on reload systemd-resolved

When systemd-resolved is used in resolv.conf foreign mode, reloading the
systemd-resolved daemon does not read resolv.conf when not touched since
the last time resolved read the file. Since the DNS servers list is
flushed during a reload, resolved forgets about the servers
in /etc/resolv.conf

When reloading the daemon it is expected that all configuration is
reloaded regardless of the disk timestamps.
This commit is contained in:
Pasquale van Heumen
2025-12-09 16:45:10 +01:00
committed by Yu Watanabe
parent a40f4ba1a8
commit ca1d2ae5d6

View File

@@ -641,6 +641,7 @@ static void manager_set_defaults(Manager *m) {
m->cache_from_localhost = false;
m->stale_retention_usec = 0;
m->refuse_record_types = set_free(m->refuse_record_types);
m->resolv_conf_stat = (struct stat) {};
}
static int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {