ZOSOpenTools / meta

Meta repository to tie together the various underlying z/OS Open Source tools repositories here
https://zosopentools.github.io/meta/
Apache License 2.0
37 stars 25 forks source link

Issue with bash install of 5.2.21.20240306_191623 #722

Open gngrossi opened 3 months ago

gngrossi commented 3 months ago

Tried to install bash 5.2.21.20240306_191623...took a long time and canceled it. Noticed it was running grep on directories that are not part of the zopen file system. Also, tried --reinstall.

Reverted back to the previous release and ran zopen clean. bash-5.2$ zopen alt --set bash bash-5.2.21.20240126_140514.zos

zopen_install_bash.txt

zopen_reinstall_bash.txt

IgorTodorovskiIBM commented 3 months ago

Hmm, grep -l ZOPEN_INSTALL_PREFIX is part of the setup.sh script.

It looks like $BASH_HOME is empty (note the /bin/find / -type f process as it should be /bin/find /path/to/bash -type f). It should be defined in .env

So, setup.sh first sources .env:

#!/bin/sh
touch ".installing"
. ./.env
...

and at some point in the.env, BASH_HOME gets set:

...
export BASH_HOME="${PWD}"
...

and then it goes back to setup.sh which runs this:

ZOPEN_INSTALL_PREFIX=$(cd "${ZOPEN_INSTALL_PREFIX}" >/dev/null 2>&1 && pwd -P)
for f in $(/bin/find $BASH_HOME/ -type f | /bin/xargs grep -l "$REPLACE_PREFIX_PATH" 2>/dev/null); do
  replaceHardcodedPath "$REPLACE_PREFIX_PATH" "${ZOPEN_INSTALL_PREFIX}" "$BASH_HOME" $f
done

We could add an error check to avoid the replaceHardcodedPath logic if the BASH_HOME envar is not set, but I'm not really sure why it's not setting it in your case.

gngrossi commented 3 months ago

After a new ssh session and sourcing the zopen config using this command defined in to an alias: . /hewitt/zopentools/zopen_repo-current/etc/zopen-config;exec bash

--

bash-5.2$ echo $BASH_HOME

bash-5.2$ pwd /hewitt/zopentools

bash-5.2$ /bin/find . -type f -name bash ./zopen_repo/usr/local/zopen/bash/bash-5.2.21.20240126_140514.zos/bin/bash

bash-5.2$ which bash /hewitt/zopentools/zopen_repo/usr/local/bin/bash

ian-burnett commented 3 months ago

Very similar situation today upgrading vim from 9.0.x to 9.1.140.

Looks like VIM_HOME wasn't set, which resulted in the setup.sh script trying to find all files under / that contained a ZOPEN_INSTALL_PREFIX string and replace it.

Removed all instances of vim, and then reinstalled which cured the problem. Not recreatable from my side of things.

Additionally, this only happened on one of the two installations that I maintain. Apart from a few additional development packages on the working system, can't explain the difference between the two systems.

gngrossi commented 3 months ago

Not sure if this matters... Installed successfully with the repo as the current directory /hewitt/zopentools/zopen_repo

14:24:57 RC=(0) [SYSA] bash-5.2$ zopen install bash

gngrossi commented 3 months ago

Same issue with installing git 2.44.0. Needed to use zopen install --reinstall

bash-5.2$ zopen --version zopen (zopen tools) 0.8.2

zopen_install-reinstall_git.txt

gngrossi commented 3 weeks ago

Same issue with installing less heads.v657.20240606_184125

Tried twice to run zopen upgrade less. The grep -l search is beyond the zopen tools file system. Had to revert back to previous using zopen alt --select less

[@02858@SYSA]$ ps -ef
     UID        PID       PPID  C    STIME TTY       TIME CMD
  @02858   17499130   17499638  - 20:08:37 ttyp0001  0:01 /bin/xargs grep -l ZOPEN_INSTALL_PREFIX
  @02858   51053765   34276783  - 20:08:24 ttyp0001  0:00 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen upgrade less
  @02858   34276783   84612130  - 07:25:08 ttyp0001  0:06 bash
  @02858     722397     724235  - 20:09:21 ttyp0004  0:00 ps -ef
  @02858   17499638   17500548  - 20:08:36 ttyp0001  0:00 /bin/sh ./setup.sh
  @02858   84608602   51053765  - 20:08:24 ttyp0001  0:00 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen-install -u less
  @02858   84608666   17499130  - 20:09:21 ttyp0001  0:00 grep -l ZOPEN_INSTALL_PREFIX /IPL021/usr/lpp/IBM/cnj/v20r0/IBM/node-v20.11.0-os390-s390x-202402131732/MIGRATION.txt /IPL021/usr/lpp/IBM/cnj/v20r0/IBM/node-v20.11.0-os390-s390x-202402131732/TROUBLESHOOT.txt /IPL021/usr/lpp/IBM/cnj/v20r0/njsc/ibm-node-1.1.0-os390.pax.Z /IPL021/usr/lpp/IBM/aie/zdnn/RELEASE /IPL021/usr/lpp/IBM/aie/zdnn/include/zdnn.h /IPL021/usr/lpp/IBM/aie/zdnn/lib/libzdnn.so /IPL021/usr/lpp/IBM/aie/zdnn/lib/libzdnn.x /IPL021/usr/lpp/IBM/aie/zaio/RELEASE /IPL021/usr/lpp/IBM/aie/zaio/include/zaio.h /IPL021/usr/lpp/IBM/aie/zaio/lib/libzaio.so /IPL021/usr/lpp/IBM/aie/zaio/lib/libzaio.x /IPL021/usr/lpp/IBM/aie/zade/RELEASE /IPL021/usr/lpp/IBM/aie/zade/bin/zade_main /IPL021/usr/lpp/IBM/aie/zade/lib/libzade.so /IPL021/usr/lpp/IBM/aie/zade/lib/zade.jar /IPL021/usr/lpp/IBM/zdg/IBM/GRBINSTA /IPL021/usr/lpp/IBM/zdg/IBM/GRBINSTB /IPL021/usr/lpp/IBM/zdg/IBM/GRBDGRSA /IPL021/usr/lpp/IBM/zdg/IBM/GRBSMFPY /IPL021/usr/lpp/IBM/zdg/IBM/GRBINST2 /IPL021/usr/lpp/IBM/zdg/IBM/GRBDGRS2 /IPL021/usr/lpp/IBM/zdg/REST/smf
  @02858   17500157     725325  - 20:09:12 ?         0:00 /usr/sbin/sshd -f /etc/ssh/sshd_config -R
  @02858   17500548   67832253  - 20:08:27 ttyp0001  0:00 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen-install -u less
  @02858   67832253   84608602  - 20:08:25 ttyp0001  0:00 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen-install -u less
  @02858   84610235   17499638  - 20:08:37 ttyp0001  0:02 /bin/find / -type f
  @02858     724235   17500157  - 20:09:12 ttyp0004  0:00 sh -L
  @02858   84612130   17498360  - 07:25:07 ?         0:01 /usr/sbin/sshd -f /etc/ssh/sshd_config -R
gngrossi commented 2 weeks ago

Tried to install bash 5.2.21.20240617_152629 The grep -l search is beyond the zopen tools file system. Had to revert back to previous 5.2.21.20240426_024419

[@02858@SYSD]$ ps -ef
     UID        PID       PPID  C    STIME TTY       TIME CMD
  @02858   34341629   84674231  - 07:35:48 ttyp0000  0:00 bash
  @02858     787356     792098  - 12:44:49 ttyp0001  0:00 ps -ef
  @02858   84673454   17566571  - 12:44:03 ttyp0000  0:02 /bin/find / -type f
  @02858   84674231   34341842  - 07:35:48 ?         0:00 /usr/sbin/sshd -f /etc/ssh/sshd_config -R
  @02858   17565646     790566  - 12:44:44 ?         0:00 /usr/sbin/sshd -f /etc/ssh/sshd_config -R
  @02858   84675152   84675983  - 12:43:19 ttyp0000  0:00 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen-install -u bash
  @02858   17566571   17567270  - 12:44:02 ttyp0000  0:01 /bin/sh ./setup.sh
  @02858   84675665   84675152  - 12:43:20 ttyp0000  0:00 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen-install -u bash
  @02858   84675983   34341629  - 12:43:19 ttyp0000  0:00 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen upgrade bash
  @02858   17567270   84675665  - 12:43:22 ttyp0000  0:01 /bin/sh /hewitt/zopentools/zopen_repo/usr/local/bin/zopen-install -u bash
  @02858   84677073   51123356  - 12:44:49 ttyp0000  0:00 grep -l ZOPEN_INSTALL_PREFIX /IPL021/usr/lpp/zosmf/workflow/usermanagement/zosunixuser/zosunixuserDynamicUser.properties /IPL021/usr/lpp/zosmf/workflow/usermanagement/zosunixuser/zosunixuserDynamicUserActions.xml /IPL021/usr/lpp/zosmf/workflow/usermanagement/zosunixuser/zosunixuserDynamicUserProvision.xml /IPL021/usr/lpp/zosmf/workflow/izu.aici.config.xml /IPL021/usr/lpp/zosmf/kc/._configuration /IPL021/usr/lpp/zosmf/kc/configuration/._usr /IPL021/usr/lpp/zosmf/kc/configuration/usr/._branding /IPL021/usr/lpp/zosmf/kc/configuration/usr/branding/._branding.properties /IPL021/usr/lpp/zosmf/kc/configuration/usr/branding/branding.properties /IPL021/usr/lpp/zosmf/kc/configuration/usr/._.DS_Store /IPL021/usr/lpp/zosmf/kc/configuration/usr/.DS_Store /IPL021/usr/lpp/zosmf/kc/configuration/usr/._content /IPL021/usr/lpp/zosmf/kc/configuration/usr/._taxonomy /IPL021/usr/lpp/zosmf/kc/configuration/usr/taxonomy/._KC_taxonomy_ja_JP.properties /IPL021/usr/lpp/zosmf/kc/configuration/usr/taxonomy/KC_taxonomy_ja_JP.properties /
  @02858   51123356   17566571  - 12:44:03 ttyp0000  0:01 /bin/xargs grep -l ZOPEN_INSTALL_PREFIX
  @02858     792098   17565646  - 12:44:44 ttyp0001  0:00 sh -L
v1gnesh commented 2 weeks ago

Hey @gngrossi, I've just noticed that I have access to edit comments (as a code owner in meta). Hope it's ok that I've updated it to add code formatting.

like so:

```sh stuff ```

gngrossi commented 1 week ago

Successfully upgraded bash.

07:44:59 RC=(0) [SYSD] bash-5.2$ zopen upgrade bash