Fix check for already setup

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@575 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2008-02-26 13:50:39 +00:00
parent 75b54bf086
commit 7c57900256
4 changed files with 30 additions and 13 deletions

View File

@ -43,6 +43,10 @@ sub handled_commands
# service needed on this Service Node
$rc = &setup_DHCP($nodename); # setup DHCP
if ($rc == 0)
{
xCAT::Utils->update_xCATSN($service);
}
}
}
return $rc;
@ -113,7 +117,6 @@ sub setup_DHCP
{ # error reading Db
$rc = 1;
}
xCAT::Utils->update_xCATSN("dhcp");
return $rc;
}
1;

View File

@ -29,7 +29,7 @@ Call setup_DNS
sub handled_commands
{
my $rc=0;
my $rc = 0;
if (xCAT::Utils->isServiceNode())
{
my @nodeinfo = xCAT::Utils->determinehostname;
@ -43,6 +43,10 @@ sub handled_commands
# service needed on this Service Node
$rc = &setup_DNS($nodename); # setup DNS
if ($rc == 0)
{
xCAT::Utils->update_xCATSN($service);
}
}
}
return $rc;
@ -166,11 +170,10 @@ sub setup_DNS
`cp /etc/named.conf /var/named/chroot/etc`;
`chkconfig --level 345 named on`;
`service named restart`;
xCAT::Utils->update_xCATSN("dns");
}
}
else
{ # error reading DB
{ # error reading DB
return 1;
}
return 0;

View File

@ -21,7 +21,8 @@ use Getopt::Long;
=head3 handled_commands
Check to see if on a Service Node
This will be setup all the time on Service Nodes
Check database to see if this node is a NFS server
should be always
Call setup_NFS
=cut
@ -37,9 +38,18 @@ sub handled_commands
my @nodeinfo = xCAT::Utils->determinehostname;
my $nodename = $nodeinfo[0];
my $nodeipaddr = $nodeinfo[1];
my $service = "nfsserver";
$rc = xCAT::Utils->isServiceReq($nodename, $service, $nodeipaddr);
if ($rc == 1)
{
# service needed on this Service Node
$rc = &setup_NFS($nodename); # setup NFS
# service needed on this Service Node
$rc = &setup_NFS($nodename); # setup NFS
if ($rc == 0)
{
xCAT::Utils->update_xCATSN($service);
}
}
}
return $rc;
}
@ -220,7 +230,6 @@ sub setup_NFS
{
`echo "$master:$installdir $installdir nfs timeo=14,intr 1 2" >>/etc/fstab`;
}
xCAT::Utils->update_xCATSN("nfs");
}
return $rc;
}

View File

@ -42,7 +42,11 @@ sub handled_commands
{
# service needed on this Service Node
$rc=&setup_TFTP($nodename); # setup TFTP
$rc = &setup_TFTP($nodename); # setup TFTP
if ($rc == 0)
{
xCAT::Utils->update_xCATSN($service);
}
}
}
return $rc;
@ -104,8 +108,7 @@ sub setup_TFTP
if (xCAT::Utils->isLinux())
{
# enable tftp
# enable tftp
my $cmd = "chkconfig tftp on";
xCAT::Utils->runcmd($cmd, -1);
@ -129,7 +132,6 @@ sub setup_TFTP
# TBD AIX tftp may already be enabled
}
xCAT::Utils->update_xCATSN("tftp");
return 0;
return 0;
}
1;