From de566bf7dd19e7890aa33a5607757a4d5d3a1ca0 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 24 Mar 2016 23:24:41 -0400 Subject: [PATCH 1/4] fix issue 496 lsf_startup in redhat7.2 --- xCAT/postscripts/lsf_startup | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/lsf_startup b/xCAT/postscripts/lsf_startup index f8c4e5ca6..37f4c4909 100644 --- a/xCAT/postscripts/lsf_startup +++ b/xCAT/postscripts/lsf_startup @@ -59,7 +59,14 @@ for lsfnode in $ALL_LSF_NODES do if [[ x${lsfnode} == x$NODE ]] then - echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile + + if grep -q -i "release 7.2" /etc/redhat-release ; then + + echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile + else + #special case for redhat7.2 + echo ". $LSF_TOP/conf/profile.lsf" >> ~/.bash_profile + fi fi done From 7d3ba4d3f8ad34880aae418b41659ec60e7dfbdf Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 28 Mar 2016 02:37:53 -0400 Subject: [PATCH 2/4] polish lsf_startup --- xCAT/postscripts/lsf_startup | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/lsf_startup b/xCAT/postscripts/lsf_startup index 37f4c4909..93c539b3d 100644 --- a/xCAT/postscripts/lsf_startup +++ b/xCAT/postscripts/lsf_startup @@ -60,12 +60,12 @@ do if [[ x${lsfnode} == x$NODE ]] then - if grep -q -i "release 7.2" /etc/redhat-release ; then + if [[ -f /root/.bash_profile ]] + then - echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile + echo ". $LSF_TOP/conf/profile.lsf" >> /root/.bash_profile else - #special case for redhat7.2 - echo ". $LSF_TOP/conf/profile.lsf" >> ~/.bash_profile + echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile fi fi done From f852193495d913a0d95b944c4fad12ffc2be46b5 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 28 Mar 2016 03:07:42 -0400 Subject: [PATCH 3/4] polish lsf_startup --- xCAT/postscripts/lsf_startup | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/lsf_startup b/xCAT/postscripts/lsf_startup index 93c539b3d..a8dd3bee9 100644 --- a/xCAT/postscripts/lsf_startup +++ b/xCAT/postscripts/lsf_startup @@ -59,13 +59,18 @@ for lsfnode in $ALL_LSF_NODES do if [[ x${lsfnode} == x$NODE ]] then - if [[ -f /root/.bash_profile ]] - then - - echo ". $LSF_TOP/conf/profile.lsf" >> /root/.bash_profile + then + if ! grep -q -i "#Added by lsf_startup" /root/.bash_profile ; then + echo "#Added by lsf_startup." + echo ". $LSF_TOP/conf/profile.lsf" >> /root/.bash_profile + fi else - echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile + if ! grep -q -i "#Added by lsf_startup" /root/.profile ; then + echo "#Added by lsf_startup." + echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile + fi + fi fi done From 95a8db39f2caef8a17d94e6af15c2c75167dbbda Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 28 Mar 2016 03:10:43 -0400 Subject: [PATCH 4/4] polish lsf_startup --- xCAT/postscripts/lsf_startup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/lsf_startup b/xCAT/postscripts/lsf_startup index a8dd3bee9..d23f83a51 100644 --- a/xCAT/postscripts/lsf_startup +++ b/xCAT/postscripts/lsf_startup @@ -62,12 +62,12 @@ do if [[ -f /root/.bash_profile ]] then if ! grep -q -i "#Added by lsf_startup" /root/.bash_profile ; then - echo "#Added by lsf_startup." + echo "#Added by lsf_startup." >> /root/.bash_profile echo ". $LSF_TOP/conf/profile.lsf" >> /root/.bash_profile fi else if ! grep -q -i "#Added by lsf_startup" /root/.profile ; then - echo "#Added by lsf_startup." + echo "#Added by lsf_startup." >> /root/.profile echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile fi