From aa025ac91d1b95e004b7abeceabf6bf355c39012 Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 13 Mar 2008 12:08:34 +0000 Subject: [PATCH] Add isMS routine to check if running on the management Server git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@773 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/Utils.pm | 50 +++++++++++++++++++++++++++++++++++++ xCAT/xCAT.spec | 3 ++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/perl-xCAT-2.0/xCAT/Utils.pm b/perl-xCAT-2.0/xCAT/Utils.pm index 86f50130d..ad4be8492 100644 --- a/perl-xCAT-2.0/xCAT/Utils.pm +++ b/perl-xCAT-2.0/xCAT/Utils.pm @@ -1002,7 +1002,57 @@ sub isServiceNode return 0; } } +#------------------------------------------------------------------------------- +=head3 isMS + checks for the /etc/xCATMS file , if it exists is a Management Server + + Arguments: + none + Returns: + 1 - localHost is ServiceNode + 0 - localHost is not ServiceNode + Globals: + none + Error: + none + Example: + $return=(xCAT::Utils->isMS()) + Comments: + none +=cut + +#------------------------------------------------------------------------------- +sub isMS +{ + my $value; + if (-e "/etc/xCATMS") + { + return 1; + } + else + { + return 0; + } +} + +#------------------------------------------------------------------------------- + +=head3 my_hexnets + + Arguments: + none + Returns: + Globals: + none + Error: + none + Example: + Comments: + none +=cut + +#------------------------------------------------------------------------------- sub my_hexnets { my $rethash; diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 3a667fb5e..e518ac575 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -146,7 +146,8 @@ if [ "$1" = "1" ]; then #Only if installing for the fist time.. cp -r /root/.xcat/* /install/postscripts/.xcat #Zap the almost certainly wrong pxelinux.cfg file rm /tftpboot/pxelinux.cfg/default - + # make Management Server + touch /etc/xCATMS # setup syslog if [ ! -r /etc/syslog.conf.XCATORIG ]; then cp /etc/syslog.conf /etc/syslog.conf.XCATORIG