Move the setup of /etc/profile to the xcatconfig command.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4510 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
nott 2009-11-06 20:27:08 +00:00
parent f07e8cdab2
commit 9113e20669
2 changed files with 29 additions and 9 deletions

View File

@ -218,13 +218,6 @@ chmod 755 /etc/profile.d/xcat.*
%else
if [ "$1" = "1" ]; then #Only if installing for the first time..
echo "
# xCAT setup
XCATROOT=$RPM_INSTALL_PREFIX0
PATH=\$PATH:\$XCATROOT/bin:\$XCATROOT/sbin
MANPATH=\$MANPATH:\$XCATROOT/share/man
export XCATROOT PATH MANPATH" >>/etc/profile
echo "
# xCAT Perl setup
PERL5LIB=/usr/opt/perl5/lib/5.8.2:/usr/opt/perl5/lib/5.8.2/aix-thread-multi:/usr/opt/perl5/lib/site_perl/5.8.2:/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi " >>/etc/environment

View File

@ -203,6 +203,33 @@ if ($::INITIALINSTALL || $::FORCE || $::genSSHRootKeys)
&genSSHRootKeys; # gen new rsa ssh key for root
}
#
# Update /etc/profile on AIX
#
if ($::INITIALINSTALL) {
my $profname="/etc/profile";
if ($::osname eq 'AIX') {
my $cmd = qq~cat $profname | grep "XCATROOT"~;
my $outref = xCAT::Utils->runcmd("$cmd", -1);
if ($::RUNCMD_RC != 0) {
# make back up file
my $cpcmd = qq~/bin/cp -p $profname $profname.orig~;
my $outref = xCAT::Utils->runcmd("$cpcmd", 0);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->message('E',"Could not copy $profname.");
}
# add xCAT paths
my $eccmd = qq~echo '# xCAT setup\nXCATROOT=$::XCATROOT\nPATH=\$PATH:\$XCATROOT/bin:\$XCATROOT/sbin\nMANPATH=\$MANPATH:\$XCATROOT/share/man\nexport XCATROOT PATH MANPATH' >>$profname~;
my $outref = xCAT::Utils->runcmd("$eccmd", 0);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->message('E',"Could not update $profname.");
}
}
}
}
if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL)
{
@ -865,8 +892,8 @@ sub initDB
$chtabcmds .= "$::XCATROOT/sbin/chtab key=xcatconfdir site.value=$confdir;";
$chtabcmds .=
"$::XCATROOT/sbin/chtab key=timezone site.value=$timezone;";
$chtabcmds .=
"$::XCATROOT/sbin/chtab key=useNmapfromMN site.value=no;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=useNmapfromMN site.value=no;";
if ($::osname eq 'AIX')
{