mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 19:18:00 +02:00
dns: rewrite "resolv.conf" on SIGHUP and SIGUSR1
Also rewrite resolv.conf if the configuration didn't actually change.
Especially, react on SIGUSR1 which does not reload the configuration but
only writes "resolv.conf".
https://bugzilla.redhat.com/show_bug.cgi?id=1062301
(cherry picked from commit 68f1203c7c)
This commit is contained in:
parent
c16a9665a3
commit
2ce2f1f946
1 changed files with 9 additions and 7 deletions
|
|
@ -1141,14 +1141,16 @@ config_changed_cb (NMConfig *config,
|
|||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!(changes & NM_CONFIG_CHANGE_DNS_MODE))
|
||||
return;
|
||||
if (NM_FLAGS_HAS (changes, NM_CONFIG_CHANGE_DNS_MODE))
|
||||
init_resolv_conf_mode (self);
|
||||
|
||||
init_resolv_conf_mode (self);
|
||||
if (!update_dns (self, TRUE, &error)) {
|
||||
nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s",
|
||||
error->code, error->message);
|
||||
g_clear_error (&error);
|
||||
if (NM_FLAGS_ANY (changes, NM_CONFIG_CHANGE_SIGHUP |
|
||||
NM_CONFIG_CHANGE_SIGUSR1 |
|
||||
NM_CONFIG_CHANGE_DNS_MODE)) {
|
||||
if (!update_dns (self, TRUE, &error)) {
|
||||
nm_log_warn (LOGD_DNS, "could not commit DNS changes: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue