xcat-core/xCAT/postscripts/servicenode
2008-04-24 13:29:36 +00:00

59 lines
1.1 KiB
Perl
Executable File

#!/usr/bin/perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#egan@us.ibm.com
#(C)IBM Corp
#
#-----------------------------------------------------------------------------
=head1 servicenode
This updates the service node with files necessary to access the
database on the MasterNode and restarts the xcat daemon
=cut
#-----------------------------------------------------------------------------
#
# remove OpenIPMI-tools and tftp
# install xcat from /install/xcat
# Copy Certificates, and config file to apprpriate directories from /install
# and restart xcatd
# MAIN
my $rc=0;
&runcmd("rpm -e OpenIPMI-tools");
&runcmd("rpm -e tftp-server");
if ($ENV{'NODESETSTATE'} eq "install")
{
$msg = "Installing xCAT";
`logger -t xcat $msg`;
&runcmd("rpm -ivh /xcatpost/xcat/RPMS/*/*.rpm");
}
&runcmd("/opt/xcat/sbin/copycerts");
#
# run the command
#
sub runcmd
{
my ($cmd) = @_;
my $rc;
$cmd .= ' 2>&1' ;
my $outref = [];
@$outref = `$cmd`;
if ($?)
{
$rc = $? >> 8;
if ($rc > 0)
{
`logger -t xcat @$outref`;
}
}
return $rc;
}
exit $rc;