mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 17:20:31 +01: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
This commit is contained in:
parent
caed15e082
commit
68f1203c7c
1 changed files with 12 additions and 8 deletions
|
|
@ -1303,15 +1303,19 @@ config_changed_cb (NMConfig *config,
|
|||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!NM_FLAGS_ANY (changes, NM_CONFIG_CHANGE_DNS_MODE |
|
||||
NM_CONFIG_CHANGE_RC_MANAGER))
|
||||
return;
|
||||
if (NM_FLAGS_HAS (changes, NM_CONFIG_CHANGE_DNS_MODE))
|
||||
init_resolv_conf_mode (self);
|
||||
if (NM_FLAGS_HAS (changes, NM_CONFIG_CHANGE_RC_MANAGER))
|
||||
init_resolv_conf_manager (self);
|
||||
|
||||
init_resolv_conf_mode (self);
|
||||
init_resolv_conf_manager (self);
|
||||
if (!update_dns (self, TRUE, &error)) {
|
||||
nm_log_warn (LOGD_DNS, "could not commit DNS changes: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
if (NM_FLAGS_ANY (changes, NM_CONFIG_CHANGE_SIGHUP |
|
||||
NM_CONFIG_CHANGE_SIGUSR1 |
|
||||
NM_CONFIG_CHANGE_DNS_MODE |
|
||||
NM_CONFIG_CHANGE_RC_MANAGER)) {
|
||||
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