diff --git a/src/backends/NetworkManagerRedHat.c b/src/backends/NetworkManagerRedHat.c index c14eb837aa..843b03b20b 100644 --- a/src/backends/NetworkManagerRedHat.c +++ b/src/backends/NetworkManagerRedHat.c @@ -35,7 +35,11 @@ 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)) { - nm_spawn_process ("/etc/init.d/nscd condrestart"); + 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"); } }