distro: remove nm_backend_update_dns()

This function was basically the same for all distributions and
was used only in one place. It tried to restart nscd or ask it
to reload configuration. This is not necessary as nscd uses
inotify to watch /etc/resolv.conf.
This commit is contained in:
Pavel Šimerda 2012-08-01 21:10:15 +02:00 committed by Dan Williams
parent c200e3fddf
commit 97745c7498
17 changed files with 0 additions and 131 deletions

View file

@ -43,16 +43,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Make glibc/nscd aware of any changes to the resolv.conf file by
* restarting nscd; check if the daemon was already running - do not
* start a new instance
*/
if (g_file_test("/var/run/daemons/nscd", G_FILE_TEST_EXISTS))
nm_spawn_process ("/etc/rc.d/nscd restart");
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -41,15 +41,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Invalidate the nscd host cache since we changed resolv.conf */
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) {
nm_log_info (LOGD_DNS, "Clearing nscd hosts cache.");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -36,17 +36,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Make glibc/nscd aware of any changes to the resolv.conf file by
* restarting nscd. Only restart if already running.
*/
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) {
nm_log_info (LOGD_DNS, "Clearing nscd hosts cache.");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -31,11 +31,6 @@ void nm_backend_enable_loopback (void)
fwnet_loup ();
}
void nm_backend_update_dns (void)
{
/* I'm not running nscd */
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -102,17 +102,6 @@ out:
rtnl_addr_put (addr);
}
/*
* nm_generic_update_dns
*
* Make glibc/nscd aware of any changes to the resolv.conf file by
* restarting nscd.
*
*/
void nm_generic_update_dns (void)
{
}
/*
* nm_generic_ipv6_use_tempaddr
*
@ -164,11 +153,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
nm_generic_update_dns ();
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -27,7 +27,6 @@
#include "nm-backend.h"
void nm_generic_enable_loopback (void);
void nm_generic_update_dns (void);
int nm_generic_ipv6_use_tempaddr (void);
#endif /* NM_GENERIC_H */

View file

@ -64,17 +64,6 @@ void nm_backend_enable_loopback (void)
g_free (comm);
}
void nm_backend_update_dns (void)
{
/* Make glibc/nscd aware of any changes to the resolv.conf file by
* restarting nscd. Only restart if already running.
*/
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) {
nm_log_info (LOGD_DNS, "Clearing nscd hosts cache.");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -38,12 +38,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
if (g_file_test("/var/run/nscd/nscd.pid", G_FILE_TEST_EXISTS))
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -37,15 +37,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Invalidate the nscd host cache, if it exists, since we changed resolv.conf */
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) {
nm_log_info (LOGD_DNS, "Clearing nscd hosts cache.");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -33,15 +33,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Invalidate the nscd host cache, if it exists, since we changed resolv.conf */
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_REGULAR)) {
nm_spawn_process ("/etc/init.d/nscd condrestart");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -35,15 +35,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Invalidate the nscd host cache, if it exists, since we changed resolv.conf */
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) {
nm_log_info (LOGD_DNS, "Clearing nscd hosts cache.");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -31,10 +31,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -31,19 +31,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Invalidate the nscd host cache since we changed resolv.conf */
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_REGULAR)) {
if (g_file_test ("/etc/init.d/nscd", G_FILE_TEST_EXISTS))
nm_spawn_process ("/etc/init.d/nscd condrestart");
else if (g_file_test ("/bin/systemctl", G_FILE_TEST_IS_EXECUTABLE))
nm_spawn_process ("/bin/systemctl condrestart nscd.service");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -31,10 +31,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -36,15 +36,6 @@ void nm_backend_enable_loopback (void)
nm_generic_enable_loopback ();
}
void nm_backend_update_dns (void)
{
/* Invalidate the nscd host cache, if it exists, since we changed resolv.conf */
if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) {
nm_log_info (LOGD_DNS, "Clearing nscd hosts cache.");
nm_spawn_process ("/usr/sbin/nscd -i hosts");
}
}
int nm_backend_ipv6_use_tempaddr (void)
{
return nm_generic_ipv6_use_tempaddr ();

View file

@ -24,7 +24,6 @@
/* Random disto-specific stuff */
void nm_backend_enable_loopback (void);
void nm_backend_update_dns (void);
int nm_backend_ipv6_use_tempaddr (void);
#endif /* NM_BACKEND_H */

View file

@ -40,7 +40,6 @@
#include "nm-ip4-config.h"
#include "nm-ip6-config.h"
#include "nm-logging.h"
#include "backends/nm-backend.h"
#include "NetworkManagerUtils.h"
#include "nm-posix-signals.h"
@ -766,9 +765,6 @@ update_dns (NMDnsManager *self,
if (success == FALSE)
success = update_resolv_conf (domain, searches, nameservers, iface, error);
if (success)
nm_backend_update_dns ();
if (searches)
g_strfreev (searches);
if (nameservers)