mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-30 19:02:27 +00:00 
			
		
		
		
	start named on boot.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11646 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -805,6 +805,35 @@ sub setup_DNS | ||||
|         return 1; | ||||
|     } | ||||
|  | ||||
|     # start named on boot | ||||
|     if (xCAT::Utils->isAIX()) | ||||
|     { | ||||
|         #/etc/inittab | ||||
|         my $cmd = "/usr/sbin/lsitab named > /dev/null 2>&1"; | ||||
|         my $rc = system("$cmd") >>8; | ||||
|         if ($rc != 0) | ||||
|         { | ||||
|             #add new entry | ||||
|             my $mkcmd = qq~/usr/sbin/mkitab "named:2:once:/usr/sbin/named > /dev/console 2>&1"~; | ||||
|             system("$mkcmd"); | ||||
|             xCAT::MsgUtils->message("SI", " named has been enabled on boot."); | ||||
|         } | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         #chkconfig | ||||
|         my $cmd = "/sbin/chkconfig $serv on"; | ||||
|         my $outref = xCAT::Utils->runcmd("$cmd", 0); | ||||
|         if ($::RUNCMD_RC != 0) | ||||
|         { | ||||
|             xCAT::MsgUtils->message("SE", " Error: Could not enable $serv."); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             xCAT::MsgUtils->message("SI", " $serv has been enabled on boot."); | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -522,6 +522,42 @@ sub process_request { | ||||
|         $ctx->{resolver} = Net::DNS::Resolver->new(nameservers=>['127.0.0.1']); # default to localhost | ||||
|     } | ||||
|     add_or_delete_records($ctx); | ||||
|  | ||||
|     # start named on boot | ||||
|     if (xCAT::Utils->isAIX()) | ||||
|     { | ||||
|         #/etc/inittab | ||||
|         my $cmd = "/usr/sbin/lsitab named > /dev/null 2>&1"; | ||||
|         my $rc = system("$cmd") >>8; | ||||
|         if ($rc != 0) | ||||
|         { | ||||
|             #add new entry | ||||
|             my $mkcmd = qq~/usr/sbin/mkitab "named:2:once:/usr/sbin/named > /dev/console 2>&1"~; | ||||
|             system("$mkcmd"); | ||||
|              | ||||
|             my $rsp = {}; | ||||
|             $rsp->{data}->[0] = "named has been enabled on boot."; | ||||
|             xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|         } | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         #chkconfig | ||||
|         my $cmd = "/sbin/chkconfig $service on"; | ||||
|         my $outref = xCAT::Utils->runcmd("$cmd", 0); | ||||
|         if ($::RUNCMD_RC != 0) | ||||
|         { | ||||
|             my $rsp = {}; | ||||
|             $rsp->{data}->[0] = "Could not enable $service."; | ||||
|             xCAT::MsgUtils->message("E", $rsp, $callback, 1); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             my $rsp = {}; | ||||
|             $rsp->{data}->[0] = "$service has been enabled on boot."; | ||||
|             xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|         } | ||||
|     } | ||||
|     xCAT::SvrUtils::sendmsg("DNS setup is completed", $callback); | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user