2008-02-19 13:38:14 +00:00
|
|
|
#!/usr/bin/perl
|
2007-10-26 22:44:33 +00:00
|
|
|
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
#(C)IBM Corp
|
|
|
|
|
2008-02-19 13:38:14 +00:00
|
|
|
#
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-02-19 13:38:14 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-02-19 13:38:14 +00:00
|
|
|
=head1 servicenode
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-02-19 13:38:14 +00:00
|
|
|
This updates the service node with files necessary to access the
|
|
|
|
database on the MasterNode and restarts the xcat daemon
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-02-19 13:38:14 +00:00
|
|
|
=cut
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-02-19 13:38:14 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-02-19 13:38:14 +00:00
|
|
|
#
|
2008-02-28 15:04:19 +00:00
|
|
|
# remove OpenIPMI-tools and tftp
|
|
|
|
# install xcat from /install/xcat
|
|
|
|
# Copy Certificates, and config file to apprpriate directories from /install
|
2008-04-24 13:29:36 +00:00
|
|
|
# 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");
|
2008-04-15 19:44:32 +00:00
|
|
|
}
|
2008-04-24 13:29:36 +00:00
|
|
|
&runcmd("/opt/xcat/sbin/copycerts");
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-04-24 13:29:36 +00:00
|
|
|
#
|
|
|
|
# run the command
|
|
|
|
#
|
|
|
|
sub runcmd
|
|
|
|
{
|
|
|
|
my ($cmd) = @_;
|
|
|
|
my $rc;
|
|
|
|
$cmd .= ' 2>&1' ;
|
|
|
|
my $outref = [];
|
|
|
|
@$outref = `$cmd`;
|
|
|
|
if ($?)
|
|
|
|
{
|
|
|
|
$rc = $? >> 8;
|
|
|
|
if ($rc > 0)
|
|
|
|
{
|
2008-05-15 17:18:04 +00:00
|
|
|
my $msg="$cmd returned rc=$rc @$outref\n";
|
2008-05-15 14:52:25 +00:00
|
|
|
`logger -t xcat $msg`;
|
2008-04-24 13:29:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return $rc;
|
|
|
|
}
|
|
|
|
exit $rc;
|
2007-10-26 22:44:33 +00:00
|
|
|
|