From 247bd27e1d8aad58f48aeed1c6437caa10f97c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 10 May 2012 17:40:18 +0200 Subject: [PATCH] backends: fix nscd condrestart for systemd installations (rh #805531) This also inhibits pointless error message that '/etc/init.d/nscd condrestart' could not be spawned. --- src/backends/NetworkManagerRedHat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"); } }