diff --git a/xCAT-openbmc-py/xCAT-openbmc-py3.build b/xCAT-openbmc-py/xCAT-openbmc-py3.build new file mode 100644 index 000000000..1235030e3 --- /dev/null +++ b/xCAT-openbmc-py/xCAT-openbmc-py3.build @@ -0,0 +1,68 @@ +%undefine __brp_mangle_shebangs +Summary: xCAT openbmc python3 +Name: xCAT-openbmc-py3 +#Version: %{?version:%{version}}%{!?version:%(cat Version)} +Version: 2.14.6 +Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Epoch: 1 +License: EPL +Group: Applications/System +Source: xCAT-openbmc-py-%{version}.tar.gz +Packager: IBM Corp. +Vendor: IBM Corp. +Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} +Prefix: /opt/xcat +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root + +%ifnos linux +AutoReqProv: no +%endif + +BuildArch: noarch +Requires: xCAT-server +Requires: python3-gevent >= 1.2.2-2 +Requires: python3-greenlet >= 0.4.13-2 +Requires: python3-paramiko >= 2.0.0 +Requires: python3-docopt python3-requests python3-scp + +%description +xCAT-openbmc-py3 provides openbmc related functions python3 based. + +%prep +%setup -q -n xCAT-openbmc-py +%build + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish +install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent +install -m644 lib/python/agent/common/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common +install -m644 lib/python/agent/hwctl/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl +install -m644 lib/python/agent/hwctl/openbmc/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc/ +install -m644 lib/python/agent/hwctl/redfish/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish/ + +%ifnos linux +rm -rf $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{prefix} + +%changelog + +%pre + +%post + +%preun + diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index ce095116f..0873872b7 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -503,11 +503,13 @@ sub is_goconserver_running { sub switch_goconserver { my $callback = shift; # ignore SN as it is handled by AAsn - if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) { my $cmd = "systemctl disable conserver"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + if (-x "/usr/sbin/conserver") { + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } } $cmd = "systemctl enable goconserver"; xCAT::Utils->runcmd($cmd, -1); @@ -535,11 +537,13 @@ sub switch_goconserver { sub switch_conserver { my $callback = shift; # ignore SN as it is handled by AAsn - if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) { my $cmd = "systemctl disable goconserver"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + if (-x "/usr/bin/goconserver") { + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } } $cmd = "systemctl enable conserver"; xCAT::Utils->runcmd($cmd, -1); diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 801581446..0da104fa0 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -394,7 +394,7 @@ sub subvars { $inc =~ s/#COLONHTTPPORT#/$httpportsuffix/eg; if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) { - $inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#/ /g; + $inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#//g; } if ($::XCATSITEVALS{xcatdebugmode} eq "2") { diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index b95582e51..66abd34db 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -77,7 +77,7 @@ try: received = newSocket.recv(200) if not received: break - command = re.split('\s+',received) + command = re.split(b'\s+',received) if(command[0] == b"stat"): ilog = "" line = "" @@ -113,11 +113,11 @@ try: newSocket.send(line.encode()) break #UNCOMMENTOENABLEDEBUGPORT# if(command[0] == b"sh"): #DEBUG purposes only, wide open root priv command here. -#UNCOMMENTOENABLEDEBUGPORT# newcommand = "" +#UNCOMMENTOENABLEDEBUGPORT# newcommand = b"" #UNCOMMENTOENABLEDEBUGPORT# for i in command[1:]: -#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + " " -#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand).read() -#UNCOMMENTOENABLEDEBUGPORT# newSocket.send(output.encode()) +#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + b" " +#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand.decode('utf-8')).read().encode() +#UNCOMMENTOENABLEDEBUGPORT# newSocket.send(output) #UNCOMMENTOENABLEDEBUGPORT# break if(command[0] == b"screendump"): newcommand = "cat /dev/vcs" diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk index 204310660..7676e73ce 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk @@ -69,11 +69,16 @@ xCATCmd () { ARCH=`uname -m` if [ x$ARCH = x"ppc64" -a x$OS = x"rh" ]; then /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 \ + $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | + grep -m 1 -o -- -no_ssl2) \ -connect ${1} -rand /bin/bash 2>/dev/null \ <<<"${2}" else LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 \ ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 \ + $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 \ + ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | + grep -m 1 -o -- -no_ssl2) \ -connect ${1} -rand /bin/bash 2>/dev/null \ <<<"${2}" fi diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index cef1ac789..fa6549464 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -128,7 +128,7 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 -connect ${1} -rand /bin/bash 2>/dev/null <<<"${2}" + LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/bash 2>/dev/null <<<"${2}" } diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 6f37f6465..8aa5dac22 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -128,7 +128,7 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 -connect ${1} -rand /bin/nice 2>/dev/null + echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null } diff --git a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle index f523dfe2f..f3face903 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle @@ -69,3 +69,4 @@ rpower_reset runcmdinstaller_command redhat_migration1 redhat_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index 52df8ce98..f4f1f4460 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -72,3 +72,4 @@ rpower_reset runcmdinstaller_command redhat_migration1 redhat_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index a06f89c06..670d00f7b 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -72,3 +72,4 @@ rpower_reset runcmdinstaller_command redhat_migration1 redhat_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle index 898f66a67..1bc819e65 100644 --- a/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle @@ -12,3 +12,4 @@ reg_linux_diskless_installation_flat reg_linux_statelite_installation_flat sles_migration1 sles_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index 08534fe14..0c9bbdee1 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -19,3 +19,4 @@ reg_linux_diskless_installation_flat reg_linux_statelite_installation_flat sles_migration1 sles_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index f6928afe4..7cfc1e238 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -19,3 +19,4 @@ reg_linux_diskless_installation_flat reg_linux_statelite_installation_flat sles_migration1 sles_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle index f45b09f29..38085b775 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle @@ -14,3 +14,4 @@ packimage_m_tar_c_xz packimage_o_p_a_m rmimage_diskless ubuntu_migration2_p8le +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle index c25018857..65a2d68aa 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle @@ -14,3 +14,4 @@ packimage_m_tar_c_xz packimage_o_p_a_m rmimage_diskless ubuntu_migration2_vm +linux_diskless_kdump diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 295447b77..3a61bcfc0 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -101,7 +101,7 @@ if [ ! -z "$DUMP" ]; then MOUNTPATH="" if (pmatch $OSVER "*6\.*"); then MOUNTPATH="/tmp" - elif (pmatch $OSVER "*7\.*"); then + elif (pmatch $OSVER "*[78]\.*"); then MOUNTPATH="/mnt" else MOUNTPATH="/var/tmp" @@ -215,7 +215,7 @@ EOF mv ${oldremount}.bak $oldremount fi else - if (pmatch $OSVER "rhel7*") || (pmatch $OSVER "rhels7*");then + if (pmatch $OSVER "rhel[78]*") || (pmatch $OSVER "rhels[78]*");then nfsvers=$(/usr/sbin/rpcinfo -p $KDIP|grep -w nfs|awk /tcp/'{print $2}'|sort) nfsver=0 if [ -n "$nfsvers" ]; then @@ -246,8 +246,10 @@ EOF echo "nfs $KDIP:$KDPATH" > /etc/kdump.conf echo "default shell" >> /etc/kdump.conf - #strip "xcat" out of the initramfs for kdump - echo "dracut_args --omit \"xcat\"" >> /etc/kdump.conf + if (pmatch $OSVER "rhel7*") || (pmatch $OSVER "rhels7*");then + #strip "xcat" out of the initramfs for kdump + echo "dracut_args --omit \"xcat\"" >> /etc/kdump.conf + fi #strip the unnecessary kernel options from /proc/cmdline #the modified "cmdline" will be used as the kernel options #for kdump initramfs; otherwise, the "service kdump restart" will fail diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index 5873b253b..67300becf 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -2,6 +2,9 @@ BEGIN { if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) { server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { + server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + } } else { server = "/inet/tcp/0/127.0.0.1/400" } diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index d0d49dd88..985b34dcb 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -2,6 +2,9 @@ BEGIN { if (ENVIRON["USEOPENSSLFORXCAT"]) { server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + } } else { server = "/inet/tcp/0/127.0.0.1/400" } diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index abb4b3219..1161d1836 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -619,6 +619,36 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do repo_base="/etc/apt/sources.list.d" fi + + urlrepoindex=0 + #add repo for url repos in otherpkgdir + if [ -n "OTHERPKGDIR_INTERNET" ];then + OIFS=$IFS + IFS=',' + OTHERPKGDIRLIST_INTERNET=($OTHERPKGDIR_INTERNET) + + + for url in ${OTHERPKGDIRLIST_INTERNET[@]} + do + if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then + REPOFILE="$repo_base/xCAT-otherpkgs$urlrepoindex.repo" + echo "[xcat-otherpkgs$urlrepoindex]" > $REPOFILE + echo "name=xcat-otherpkgs$urlrepoindex" >> $REPOFILE + echo "baseurl=$url" >> $REPOFILE + echo "enabled=1" >> $REPOFILE + echo "gpgcheck=0" >> $REPOFILE + echo "skip_if_unavailable=True" >> $REPOFILE + + elif [ $hasapt -eq 1 ] ; then + REPOFILE="$repo_base/xCAT-otherpkgs${urlrepoindex}.list" + echo "deb "$url >> $REPOFILE + fi + urlrepoindex=$[urlrepoindex+1] + done + + IFS=$OIFS + fi + array_empty repo_path repo_pkgs="" repo_pkgs_preremove="" @@ -700,10 +730,11 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do #try to add the path to the repo if [ $try_repo -eq 1 ]; then index=$(array_get_size repo_path) + localrepoindex=$[urlrepoindex+index] if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.repo" - echo "[xcat-otherpkgs$index]" > $REPOFILE - echo "name=xcat-otherpkgs$index" >> $REPOFILE + REPOFILE="$repo_base/xCAT-otherpkgs$localrepoindex.repo" + echo "[xcat-otherpkgs$localrepoindex]" > $REPOFILE + echo "name=xcat-otherpkgs$localrepoindex" >> $REPOFILE if [ $mounted -eq 0 ]; then echo "baseurl=http://$whole_path" >> $REPOFILE else @@ -711,6 +742,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi echo "enabled=1" >> $REPOFILE echo "gpgcheck=0" >> $REPOFILE + echo "skip_if_unavailable=True" >> $REPOFILE if [ $hasyum -eq 1 ]; then yum clean all fi @@ -722,7 +754,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi fi elif [ $hasapt -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.list" + REPOFILE="$repo_base/xCAT-otherpkgs$localrepoindex.list" if [ -n "$OTHERPKGDIR" ];then if [ $mounted -eq 0 ]; then type=http @@ -731,16 +763,6 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi echo "deb $type://$whole_path ./" > $REPOFILE fi - if [ -n "$OTHERPKGDIR_INTERNET" ] && [ $index -eq 0 ] ;then - OLDIFS=$IFS - IFS=$',' - urlarray=($OTHERPKGDIR_INTERNET) - for url in ${urlarray[@]} - do - echo "deb "$url >> $REPOFILE - done - IFS=$OLDIFS - fi fi fi if [ $hasyum -eq 1 ]; then @@ -798,38 +820,6 @@ EOF` fi done - #add repo for url repos in otherpkgdir - if [ -n "OTHERPKGDIR_INTERNET" ];then - OIFS=$IFS - IFS=',' - OTHERPKGDIRLIST_INTERNET=($OTHERPKGDIR_INTERNET) - - index=$(array_get_size repo_path) - for url in ${OTHERPKGDIRLIST_INTERNET[@]} - do - if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.repo" - echo "[xcat-otherpkgs$index]" > $REPOFILE - echo "name=xcat-otherpkgs$index" >> $REPOFILE - echo "baseurl=$url" >> $REPOFILE - echo "enabled=1" >> $REPOFILE - echo "gpgcheck=0" >> $REPOFILE - index=$[index+1] - fi - done - - IFS=$OIFS - if [ $hasyum -eq 1 ]; then - yum clean all - fi - if [ $haszypper -eq 1 ]; then - result=`zypper --non-interactive refresh 2>&1` - if [ $VERBOSE ]; then - echo "otherpkgs: zypper --non-interactive refresh" - echo " $result" - fi - fi - fi if [ "$repoonly" -eq 1 ]; then echo "otherpkgs: "repoonly set, so ignore pkg installation ..."" diff --git a/xCAT/postscripts/startsyncfiles b/xCAT/postscripts/startsyncfiles index 9f9b79d15..9a15261a1 100755 --- a/xCAT/postscripts/startsyncfiles +++ b/xCAT/postscripts/startsyncfiles @@ -42,7 +42,7 @@ while read LINE;do RET=${RET%<*} [ "$RET" != "0" ] && RETCODE=1 fi -done < <(openssl s_client -no_ssl3 -connect $MASTER_IP:$XCATDPORT -ign_eof -quiet <<<$REQUEST) +done < <(openssl s_client -no_ssl3 $(openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect $MASTER_IP:$XCATDPORT -ign_eof -quiet <<<$REQUEST) rm -rf $RESPFILE exit $RETCODE diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index 4855cee0f..c9af5345b 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -1,7 +1,10 @@ #!/usr/bin/awk -f BEGIN { if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + } } else { server = "/inet/tcp/0/127.0.0.1/400" }