packaging changes. Default installation direcotry is /opt/xcat now. environmental variables XCATROOT, PATH and MANPATH got updated by installed the packages. Did not touch xCAT and xcatnbroot yet.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@152 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
25f5ad1a5d
commit
7cade470d5
@ -1,6 +1,11 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT_monitoring::monitorctrl;
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
use Sys::Hostname;
|
||||
use xCAT::NodeRange;
|
||||
@ -8,7 +13,7 @@ use xCAT::Table;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::Utils;
|
||||
use xCAT::Client;
|
||||
require($::XCATPREFIX."/lib/xcat/plugins/notification.pm");
|
||||
use xCAT_plugin::notification;
|
||||
|
||||
#the list store the names of the monitoring products and the file name and module names.
|
||||
#the names are stored in the "pname" column of the monitoring table.
|
||||
@ -93,7 +98,7 @@ sub start {
|
||||
my $tab = xCAT::Table->new('notification');
|
||||
my $regged=0;
|
||||
if ($tab) {
|
||||
(my $ref) = $tab->getAttribs({filename => qw(/usr/lib/xcat/monitoring/monitorctrl.pm)}, tables);
|
||||
(my $ref) = $tab->getAttribs({filename => qw(monitorctrl.pm)}, tables);
|
||||
if ($ref and $ref->{tables}) {
|
||||
$regged=1;
|
||||
}
|
||||
@ -101,7 +106,7 @@ sub start {
|
||||
}
|
||||
|
||||
if (!$regged) {
|
||||
xCAT_plugin::notification::regNotification([qw(/usr/lib/xcat/monitoring/monitorctrl.pm nodelist,monitoring -o a,u,d)]);
|
||||
xCAT_plugin::notification::regNotification([qw(monitorctrl.pm nodelist,monitoring -o a,u,d)]);
|
||||
}
|
||||
|
||||
#print "child done\n";
|
||||
@ -216,7 +221,7 @@ sub stop {
|
||||
$ret{"Stop node status monitoring with $NODESTAT_MON_NAME"}=\@ret2;
|
||||
}
|
||||
|
||||
xCAT_plugin::notification::unregNotification([qw(/usr/lib/xcat/monitoring/monitorctrl.pm)]);
|
||||
xCAT_plugin::notification::unregNotification([qw(monitorctrl.pm)]);
|
||||
|
||||
if (%ret) {
|
||||
foreach(keys(%ret)) {
|
||||
@ -362,7 +367,7 @@ sub stopMonitoring {
|
||||
$module_name=$aRef->[1];
|
||||
}
|
||||
else {
|
||||
my $file_name="/usr/lib/xcat/monitoring/" . lc($_) . "mon.pm";
|
||||
my $file_name="$::XCATROOT/lib/perl/xCAT_monitoring/" . lc($_) . "mon.pm";
|
||||
$module_name="xCAT_monitoring::" . lc($_) . "mon";
|
||||
#load the module in memory
|
||||
require $file_name;
|
||||
@ -404,7 +409,7 @@ sub stopNodeStatusMonitoring {
|
||||
my $aRef = $PRODUCT_LIST{$pname};
|
||||
$module_name=$aRef->[1];
|
||||
} else {
|
||||
my $file_name="/usr/lib/xcat/monitoring/" . lc($pname) . "mon.pm";
|
||||
my $file_name="$::XCATROOT/lib/perl/xCAT_monitoring/" . lc($pname) . "mon.pm";
|
||||
$module_name="xCAT_monitoring::" . lc($pname) . "mon";
|
||||
#load the module in memory
|
||||
require $file_name;
|
||||
@ -694,7 +699,7 @@ sub refreshProductList {
|
||||
}
|
||||
|
||||
#find out the monitoring plugin file and module name for the product
|
||||
$file_name="/usr/lib/xcat/monitoring/" . lc($pname) . "mon.pm";
|
||||
$file_name="$::XCATROOT/lib/perl/xCAT_monitoring/" . lc($pname) . "mon.pm";
|
||||
$module_name="xCAT_monitoring::" . lc($pname) . "mon";
|
||||
#load the module in memory
|
||||
require $file_name;
|
||||
|
@ -15,7 +15,7 @@ package xCAT_monitoring::templatemon;
|
||||
name to the monitoring table use chtab command. For example:
|
||||
chtab productname=XXX monitoring.nodestatmon=1 (0r 0).
|
||||
Then change the package name from xCAT_monitoring::templatemon to xCAT_monitoring::xxxmon.
|
||||
Change the file name to xxxmon.pm and copy the file to /usr/lib/xcat/monitoring/
|
||||
Change the file name to xxxmon.pm and copy the file to /opt/xcat/lib/perl/xCAT_monitoring/
|
||||
directory.
|
||||
=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -1,7 +1,11 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT_monitoring::xcatmon;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
#use xCAT::NodeRange;
|
||||
#use Socket;
|
||||
#use xCAT::Utils;
|
||||
@ -93,7 +97,7 @@ sub supportNodeStatusMon {
|
||||
#--------------------------------------------------------------------------------
|
||||
sub startNodeStatusMon {
|
||||
#print "xcatmon.startNodeStatusMon\n";
|
||||
my $newentry="*/1 * * * * /usr/sbin/xcatnodemon >> /var/log/xcatmon.log";
|
||||
my $newentry="*/3 * * * * $::XCATROOT/sbin/xcatnodemon >> /var/log/xcatmon.log";
|
||||
my ($code, $msg)=xCAT::Utils::add_cron_job($newentry);
|
||||
if ($code==0) { return (0, "started"); }
|
||||
else { return ($code, $msg); }
|
||||
@ -114,7 +118,7 @@ sub startNodeStatusMon {
|
||||
sub stopNodeStatusMon {
|
||||
#TODO: turn off the node status monitoring.
|
||||
|
||||
my $job="/usr/sbin/xcatnodemon";
|
||||
my $job="$::XCATROOT/sbin/xcatnodemon";
|
||||
my ($code, $msg)=xCAT::Utils::remove_cron_job($job);
|
||||
if ($code==0) { return (0, "stopped"); }
|
||||
else { return ($code, $msg); }
|
||||
|
@ -1,10 +1,16 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT_plugin::monctrlcmds;
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
use xCAT::NodeRange;
|
||||
use xCAT::Table;
|
||||
use xCAT::MsgUtils;
|
||||
require($::XCATPREFIX."/lib/xcat/monitoring/monitorctrl.pm");
|
||||
use xCAT_monitoring::monitorctrl;
|
||||
|
||||
1;
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT_plugin::notification;
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use xCAT::Table;
|
||||
use xCAT::NotifHandler;
|
||||
1;
|
||||
|
@ -1,5 +1,10 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use xCAT::Table;
|
||||
use xCAT::NodeRange;
|
||||
use Getopt::Long;
|
||||
|
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use xCAT::Utils;
|
||||
|
||||
use IO::Socket::SSL;
|
||||
@ -22,7 +26,7 @@ use Data::Dumper;
|
||||
use Getopt::Long;
|
||||
use Sys::Syslog;
|
||||
use xCAT::NotifHandler;
|
||||
|
||||
use xCAT_monitoring::monitorctrl;
|
||||
|
||||
|
||||
Getopt::Long::Configure("bundling");
|
||||
@ -46,7 +50,7 @@ my $sitetab=xCAT::Table->new('site');
|
||||
unless ($sitetab) {
|
||||
print ("ERROR: Unable to open basic site table for configuration\n");
|
||||
}
|
||||
$::XCATPREFIX = '/usr';
|
||||
|
||||
my ($tmp) = $sitetab->getAttribs({'key'=>'xcatdport'},'value');
|
||||
unless ($tmp) {
|
||||
die "ERROR:Need xcatdport defined in site table, try chtab key=xcatdport site.value=3001";
|
||||
@ -54,12 +58,8 @@ unless ($tmp) {
|
||||
$port = $tmp->{value};
|
||||
$sport = $tmp->{value}+1;
|
||||
|
||||
($tmp) = $sitetab->getAttribs({'key'=>'xcatprefix'},'value');
|
||||
if ($tmp and $tmp->{value}) {
|
||||
$::XCATPREFIX = $tmp->{value};
|
||||
}
|
||||
require($::XCATPREFIX."/lib/xcat/monitoring/monitorctrl.pm");
|
||||
my $plugins_dir=$::XCATPREFIX.'/lib/xcat/plugins';
|
||||
|
||||
my $plugins_dir=$::XCATROOT.'/lib/perl/xCAT_plugin';
|
||||
($tmp) = $sitetab->getAttribs({'key'=>'xcatconfdir'},'value');
|
||||
$xcatdir = (($tmp and $tmp->{value}) ? $tmp->{value} : "/etc/xcat");
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use xCAT::GlobalDef;
|
||||
use xCAT::Table;
|
||||
#use xCAT::GlobalDef;
|
||||
|
||||
require("/usr/lib/xcat/monitoring/monitorctrl.pm");
|
||||
use xCAT_monitoring::monitorctrl;
|
||||
#################################################################
|
||||
# This script is used as a cron job by the xCAT monitoring plug-in
|
||||
# to monitor the node status. To activate it, simply do
|
||||
@ -21,9 +24,9 @@ my %nodes_status_old=xCAT_monitoring::monitorctrl::getNodeStatus();
|
||||
my $tmp_node_active=$nodes_status_old{$::STATUS_ACTIVE};
|
||||
my $tmp_node_inactive=$nodes_status_old{$::STATUS_INACTIVE};
|
||||
my $tmp_node_unknown=$nodes_status_old{unknown};
|
||||
#print "active nodes: @$tmp_node_active\n";
|
||||
#print "inactive nodes: @$tmp_node_inactive\n";
|
||||
#print "unknown nodes: @$tmp_node_unknown\n";
|
||||
print "active nodes: @$tmp_node_active\n";
|
||||
print "inactive nodes: @$tmp_node_inactive\n";
|
||||
print "unknown nodes: @$tmp_node_unknown\n";
|
||||
|
||||
#get current node status
|
||||
my %nodes_status_new1=();
|
||||
|
@ -8,7 +8,7 @@ Source: xCAT-server-2.0.tar.gz
|
||||
Packager: IBM Corp.
|
||||
Vendor: IBM Corp.
|
||||
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
||||
Prefix: /usr
|
||||
Prefix: /opt/xcat
|
||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
||||
|
||||
# AIX will build with an arch of "ppc"
|
||||
@ -36,9 +36,9 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/install
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/ca
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/cons
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/xcat/plugins
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin
|
||||
mkdir -p $RPM_BUILD_ROOT/opt/csm/pm/dsh/Context
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/xcat/monitoring/samples
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/samples
|
||||
|
||||
|
||||
%ifos linux
|
||||
@ -58,35 +58,39 @@ cp share/xcat/cons/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/cons
|
||||
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/cons/*
|
||||
ln -sf /%{prefix}/share/xcat/cons/hmc $RPM_BUILD_ROOT/%{prefix}/share/xcat/cons/ivm
|
||||
|
||||
cp lib/xcat/plugins/* $RPM_BUILD_ROOT/%{prefix}/lib/xcat/plugins
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/xcat/plugins/*
|
||||
cp lib/xcat/plugins/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/*
|
||||
|
||||
cp lib/xcat/dsh/Context/* $RPM_BUILD_ROOT/opt/csm/pm/dsh/Context
|
||||
chmod 644 $RPM_BUILD_ROOT/opt/csm/pm/dsh/Context/*
|
||||
|
||||
cp -r lib/xcat/monitoring/* $RPM_BUILD_ROOT/%{prefix}/lib/xcat/monitoring
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/xcat/monitoring/*
|
||||
cp -r lib/xcat/monitoring/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/*
|
||||
|
||||
chmod 755 $RPM_BUILD_ROOT/%{prefix}/lib/xcat/monitoring/samples
|
||||
#cp lib/xcat/monitoring/samples/* $RPM_BUILD_ROOT/%{prefix}/lib/xcat/monitoring/samples
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/xcat/monitoring/samples/*
|
||||
chmod 755 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/samples
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/samples/*
|
||||
|
||||
cp lib/xcat/shfunctions $RPM_BUILD_ROOT/%{prefix}/lib/xcat
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/xcat/shfunctions
|
||||
cp lib/xcat/shfunctions $RPM_BUILD_ROOT/%{prefix}/lib
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/shfunctions
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
||||
cp etc/init.d/xcatd $RPM_BUILD_ROOT/etc/init.d
|
||||
#TODO: the next has to me moved to postscript, to detect /etc/xcat vs /etc/opt/xcat
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/xcat
|
||||
cp etc/xcat/postscripts.rules $RPM_BUILD_ROOT/etc/xcat/
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-server
|
||||
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-server
|
||||
cp README $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-server
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-server/*
|
||||
echo $RPM_BUILD_ROOT %{prefix}
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc README
|
||||
%doc LICENSE.html
|
||||
#%doc README
|
||||
#%doc LICENSE.html
|
||||
%{prefix}
|
||||
/opt/csm
|
||||
/etc/xcat
|
||||
@ -105,8 +109,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* Tue Feb 20 2007 Jarrod Johnson <jbjohnso@us.ibm.com>
|
||||
- Start core rpm for 1.3 work
|
||||
|
||||
%post
|
||||
|
||||
%post
|
||||
ln -sf $RPM_INSTALL_PREFIX0/sbin/xcatd /usr/sbin/xcatd
|
||||
if [ -x /usr/lib/lsb/install_initd ]; then
|
||||
/usr/lib/lsb/install_initd /etc/init.d/xcatd
|
||||
elif [ -x /sbin/chkconfig ]; then
|
||||
@ -122,12 +126,13 @@ fi
|
||||
if [ $1 == 0 ]; then #This means only on -e
|
||||
/etc/init.d/xcatd stop
|
||||
if [ -x /usr/lib/lsb/remove_initd ]; then
|
||||
/usr/lib/lsb/install_initd /etc/init.d/xcatd
|
||||
/usr/lib/lsb/remove_initd /etc/init.d/xcatd
|
||||
elif [ -x /sbin/chkconfig ]; then
|
||||
/sbin/chkconfig --del xcatd
|
||||
fi
|
||||
rm -f /usr/sbin/xcatd #remove the symbolic
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -47,19 +47,27 @@ else
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
$STATUS
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping xCATD"
|
||||
echo -n "Stopping xCATd "
|
||||
$STATUS >& /dev/null
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -n "xCATd not running, not stopping"
|
||||
echo -n "xCATd not running, not stopping "
|
||||
$LOG_WARNING
|
||||
exit 1
|
||||
fi
|
||||
kill -TERM -`cat /var/run/xcatd.pid`
|
||||
usleep 100000
|
||||
let i=0;
|
||||
while $STATUS >& /dev/null && [ $i -lt 15 ]; do
|
||||
usleep 100000
|
||||
let i=i+1
|
||||
done
|
||||
$STATUS >& /dev/null
|
||||
if [ "$?" == "0" ]; then
|
||||
kill -KILL -`cat /var/run/xcatd.pid`
|
||||
@ -76,11 +84,13 @@ stop)
|
||||
start)
|
||||
$STATUS >& /dev/null
|
||||
if [ "$?" == "0" ]; then
|
||||
echo -n "xCATd already running"
|
||||
echo -n "xCATd already running "
|
||||
$LOG_WARNING
|
||||
exit
|
||||
fi
|
||||
echo -n "Starting xCATd"
|
||||
echo -n "Starting xCATd "
|
||||
xcatroot=`head -n1 /etc/profile.d/xcat.sh`
|
||||
export $xcatroot
|
||||
xcatd -p /var/run/xcatd.pid && $LOG_SUCCESS || $LOG_FAILURE
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user