From 2cd7e5aaa4746793756eb544780e8bc1ea185d1e Mon Sep 17 00:00:00 2001 From: sjing Date: Sat, 27 Apr 2013 06:11:49 +0000 Subject: [PATCH] Fix for bug 3538 - sometimes stopsrc -s named takes a longer time to take effect. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16095 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ddns.pm | 45 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 48242d98b..1a3134c4d 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -540,28 +540,6 @@ sub process_request { update_namedconf($ctx); update_zones($ctx); - - # check if named is active before update dns records. - if (xCAT::Utils->isAIX()) - { - my $cmd = "/usr/bin/lssrc -s $service |grep active"; - my @output=xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) - { - system("/usr/bin/startsrc -s $service"); - xCAT::SvrUtils::sendmsg("Starting named complete", $callback); - } - } - else - { - my $cmd = "service $service status|grep running"; - my @output=xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) - { - system("service $service start"); - xCAT::SvrUtils::sendmsg("Starting named complete", $callback); - } - } if ($ctx->{restartneeded}) { xCAT::SvrUtils::sendmsg("Restarting $service", $callback); @@ -585,6 +563,29 @@ sub process_request { xCAT::SvrUtils::sendmsg([1,"Unable to update DNS due to lack of credentials in passwd to communicate with remote server"], $callback); } } + + # check if named is active before update dns records. + if (xCAT::Utils->isAIX()) + { + my $cmd = "/usr/bin/lssrc -s $service |grep active"; + my @output=xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) + { + system("/usr/bin/startsrc -s $service"); + xCAT::SvrUtils::sendmsg("Starting named complete", $callback); + } + } + else + { + my $cmd = "service $service status|grep running"; + my @output=xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) + { + system("service $service start"); + xCAT::SvrUtils::sendmsg("Starting named complete", $callback); + } + } + #now we stick to Net::DNS style updates, with TSIG if possible. TODO: kerberized (i.e. Windows) DNS server support, maybe needing to use nsupdate -g.... if ($external) {