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.
This commit is contained in:
Jiří Klimeš 2012-05-10 17:40:18 +02:00
parent c5d75dcdfa
commit 247bd27e1d

View file

@ -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");
}
}