fix for bug 3538902: move the code from ddns.pm to xcatconfig to configure named to start on boot
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13197 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
e61f51388f
commit
0a6f3cc7c5
@ -535,41 +535,6 @@ sub process_request {
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -356,6 +356,7 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL || $::genCredentials)
|
||||
# more config needed after xcatd start
|
||||
if ($::INITIALINSTALL || $::FORCE)
|
||||
{
|
||||
&startnamedonboot;
|
||||
my $cmd;
|
||||
if ($::osname eq 'Linux') {
|
||||
#Zap the almost certainly wrong pxelinux.cfg file
|
||||
@ -1876,3 +1877,44 @@ sub setupMNinDB
|
||||
}
|
||||
return;
|
||||
}
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 startnamedonboot
|
||||
|
||||
Configure named to start on boot
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub startnamedonboot
|
||||
{
|
||||
# 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("I", "named has been enabled on boot.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#chkconfig
|
||||
my $cmd = "/sbin/chkconfig named on";
|
||||
my $outref = xCAT::Utils->runcmd("$cmd", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("E", "Could not enable named.");
|
||||
}
|
||||
else
|
||||
{
|
||||
xCAT::MsgUtils->message("I", "named has been enabled on boot.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user