Change to make compatible with SLES

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@590 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2008-02-27 14:00:26 +00:00
parent 1e2af54869
commit b54b3c6294
5 changed files with 112 additions and 89 deletions

View File

@ -101,15 +101,6 @@ sub setup_CONS
{ # error
xCAT::MsgUtils->message("S", "Error running $cmd");
}
# start conserver
my $cmd = "service conserver restart";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
xCAT::MsgUtils->message("S", "Error starting Conserver");
return 1;
}
my $cmd = "chkconfig conserver on";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
@ -117,6 +108,15 @@ sub setup_CONS
xCAT::MsgUtils->message("S", "Error chkconfig conserver on");
}
# start conserver
my $cmd = "/etc/rc.d/init.d/conserver start";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
xCAT::MsgUtils->message("S", "Error starting Conserver");
return 1;
}
}
else
{ # error reading Db

View File

@ -104,7 +104,14 @@ sub setup_DHCP
xCAT::MsgUtils->message("S", "Error from $cmd, output=@output");
return 1;
}
$cmd = "service dhcpd restart";
$cmd = "chkconfig dhcpd on";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("S", "Error from $cmd");
return 1;
}
$cmd = "/etc/rc.d/init.d/dhcpd start";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{

View File

@ -98,79 +98,95 @@ sub setup_DNS
$arch = $retdata->{'arch'};
# build the named.conf file
if (($os =~ /rh/i) || ($os =~ /fe/i))
{
my $namedconfig = "/etc/named.conf";
my @nameconfigtemplate;
$nameconfigtemplate[0] = "options {directory \"/var/named\";\n";
$nameconfigtemplate[1] =
" dump-file \"/var/named/data/cache_dump.db\";\n";
$nameconfigtemplate[2] =
" statistics-file \"/var/named/data/named_stats.txt\";\n";
$nameconfigtemplate[3] = " forward only;\n";
$nameconfigtemplate[4] = " forwarders{$master;\n };\n";
$nameconfigtemplate[5] = "};\n";
$nameconfigtemplate[6] = "\n";
$nameconfigtemplate[7] = "controls {\n";
$nameconfigtemplate[8] =
" inet 127.0.0.1 allow { localhost; } keys { rndckey; };\n";
$nameconfigtemplate[9] = "};\n";
$nameconfigtemplate[10] = "\n";
$nameconfigtemplate[11] = "zone \".\" IN {\n";
$nameconfigtemplate[12] = " type hint;\n";
$nameconfigtemplate[13] = " file \"named.ca\";\n";
$nameconfigtemplate[14] = "};\n\n";
$nameconfigtemplate[15] = "zone \"localdomain\" IN {\n";
$nameconfigtemplate[16] = " type master;\n";
$nameconfigtemplate[17] = " file \"localdomain.zone\";\n";
$nameconfigtemplate[18] = " allow-update { none; };\n";
$nameconfigtemplate[19] = "};\n";
$nameconfigtemplate[20] = "\n";
$nameconfigtemplate[21] = "zone \"localhost\" IN {\n";
$nameconfigtemplate[22] = " type master;\n";
$nameconfigtemplate[23] = " file \"localhost.zone\";\n";
$nameconfigtemplate[24] = " allow-update { none; };\n";
$nameconfigtemplate[25] = "};\n";
$nameconfigtemplate[26] = "\n";
$nameconfigtemplate[27] = "zone \"0.0.127.in-addr.arpa\" IN {\n";
$nameconfigtemplate[28] = " type master;\n";
$nameconfigtemplate[29] = " file \"named.local\";\n";
$nameconfigtemplate[30] = " allow-update { none; };\n";
$nameconfigtemplate[31] = "};\n";
$nameconfigtemplate[32] = "\n";
$nameconfigtemplate[33] =
"zone \"0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa\" IN { \n";
$nameconfigtemplate[34] = " type master; \n";
$nameconfigtemplate[35] = " file \"named.ip6.local\";\n";
$nameconfigtemplate[36] = " allow-update { none; };\n";
$nameconfigtemplate[37] = "};\n";
$nameconfigtemplate[38] = "\n";
$nameconfigtemplate[39] = "zone \"255.in-addr.arpa\" IN {\n ";
$nameconfigtemplate[40] = " type master; \n";
$nameconfigtemplate[41] = " file \"named.broadcast\";\n";
$nameconfigtemplate[42] = " allow-update { none; };\n";
$nameconfigtemplate[43] = "};\n";
$nameconfigtemplate[44] = "\n";
$nameconfigtemplate[45] = "zone \"0.in-addr.arpa\" IN {\n ";
$nameconfigtemplate[46] = " type master;\n ";
$nameconfigtemplate[47] = " file \"named.zero\";\n";
$nameconfigtemplate[48] = " allow-update { none; };\n";
$nameconfigtemplate[49] = "};\n";
$nameconfigtemplate[50] = "\n";
$nameconfigtemplate[51] = "include \"/etc/rndc.key\";\n ";
my $namedconfig = "/etc/named.conf";
my @nameconfigtemplate;
$nameconfigtemplate[0] = "options {directory \"/var/named\";\n";
$nameconfigtemplate[1] =
" dump-file \"/var/named/data/cache_dump.db\";\n";
$nameconfigtemplate[2] =
" statistics-file \"/var/named/data/named_stats.txt\";\n";
$nameconfigtemplate[3] = " forward only;\n";
$nameconfigtemplate[4] = " forwarders{$master;\n };\n";
$nameconfigtemplate[5] = "};\n";
$nameconfigtemplate[6] = "\n";
$nameconfigtemplate[7] = "controls {\n";
$nameconfigtemplate[8] =
" inet 127.0.0.1 allow { localhost; } keys { rndckey; };\n";
$nameconfigtemplate[9] = "};\n";
$nameconfigtemplate[10] = "\n";
$nameconfigtemplate[11] = "zone \".\" IN {\n";
$nameconfigtemplate[12] = " type hint;\n";
$nameconfigtemplate[13] = " file \"named.ca\";\n";
$nameconfigtemplate[14] = "};\n\n";
$nameconfigtemplate[15] = "zone \"localdomain\" IN {\n";
$nameconfigtemplate[16] = " type master;\n";
$nameconfigtemplate[17] = " file \"localdomain.zone\";\n";
$nameconfigtemplate[18] = " allow-update { none; };\n";
$nameconfigtemplate[19] = "};\n";
$nameconfigtemplate[20] = "\n";
$nameconfigtemplate[21] = "zone \"localhost\" IN {\n";
$nameconfigtemplate[22] = " type master;\n";
$nameconfigtemplate[23] = " file \"localhost.zone\";\n";
$nameconfigtemplate[24] = " allow-update { none; };\n";
$nameconfigtemplate[25] = "};\n";
$nameconfigtemplate[26] = "\n";
$nameconfigtemplate[27] = "zone \"0.0.127.in-addr.arpa\" IN {\n";
$nameconfigtemplate[28] = " type master;\n";
$nameconfigtemplate[29] = " file \"named.local\";\n";
$nameconfigtemplate[30] = " allow-update { none; };\n";
$nameconfigtemplate[31] = "};\n";
$nameconfigtemplate[32] = "\n";
$nameconfigtemplate[33] =
"zone \"0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa\" IN { \n";
$nameconfigtemplate[34] = " type master; \n";
$nameconfigtemplate[35] = " file \"named.ip6.local\";\n";
$nameconfigtemplate[36] = " allow-update { none; };\n";
$nameconfigtemplate[37] = "};\n";
$nameconfigtemplate[38] = "\n";
$nameconfigtemplate[39] = "zone \"255.in-addr.arpa\" IN {\n ";
$nameconfigtemplate[40] = " type master; \n";
$nameconfigtemplate[41] = " file \"named.broadcast\";\n";
$nameconfigtemplate[42] = " allow-update { none; };\n";
$nameconfigtemplate[43] = "};\n";
$nameconfigtemplate[44] = "\n";
$nameconfigtemplate[45] = "zone \"0.in-addr.arpa\" IN {\n ";
$nameconfigtemplate[46] = " type master;\n ";
$nameconfigtemplate[47] = " file \"named.zero\";\n";
$nameconfigtemplate[48] = " allow-update { none; };\n";
$nameconfigtemplate[49] = "};\n";
$nameconfigtemplate[50] = "\n";
$nameconfigtemplate[51] = "include \"/etc/rndc.key\";\n ";
open(DNSCFG, ">$namedconfig")
or xCAT::MsgUtils->message('S',
open(DNSCFG, ">$namedconfig")
or xCAT::MsgUtils->message('S',
"Cannot open $named.conf for DNS setup \n");
print DNSCFG @nameconfigtemplate;
close DNSCFG;
print DNSCFG @nameconfigtemplate;
close DNSCFG;
# turn DNS on
# turn DNS on
`cp /etc/named.conf /var/named/chroot/etc`;
`chkconfig --level 345 named on`;
`service named restart`;
$cmd = "cp /etc/named.conf /var/named/chroot/etc";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("S", "Error from $cmd");
return 1;
}
$cmd = "chkconfig named on";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("S", "Error from $cmd");
return 1;
}
$cmd = "/etc/rc.d/init.d/named restart";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("S", "Error from $cmd");
return 1;
}
}
else
{ # error reading DB

View File

@ -145,20 +145,20 @@ sub setup_NFS
xCAT::MsgUtils->message("S", "Error exporting $tftpdir");
}
}
# make sure nfs is started
my $cmd = "service nfs restart";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
xCAT::MsgUtils->message("S", "Error starting NFS");
return 1;
}
my $cmd = "chkconfig nfs on";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
xCAT::MsgUtils->message("S", "Error chkconfig nfs on");
xCAT::MsgUtils->message("S", "Error on command:$cmd");
}
# make sure nfs is started
my $cmd = "/etc/rc.d/init.d/nfs restart";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
xCAT::MsgUtils->message("S", "Error on command: $cmd");
return 1;
}
# export the directories

View File

@ -117,7 +117,7 @@ sub setup_TFTP
xCAT::MsgUtils->message("S", "Error running $cmd");
return 1;
}
my $cmd = "service xinetd restart";
my $cmd = "/etc/rc.d/init.d/xinetd restart";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{