diff --git a/universal/ubi8/entrypoint.sh b/universal/ubi8/entrypoint.sh index 220748c4..7b050732 100755 --- a/universal/ubi8/entrypoint.sh +++ b/universal/ubi8/entrypoint.sh @@ -47,12 +47,22 @@ else ln -f -s /usr/bin/podman.orig /home/tooling/.local/bin/podman fi + +# Stow +## Required for https://github.com/eclipse/che/issues/22412 + # /home/user/ will be mounted to by a PVC if persistUserHome is enabled -if mountpoint -q /home/user/; then +mountpoint -q /home/user/; HOME_USER_MOUNTED=$? + +# This file will be created after stowing, to guard from executing stow everytime the container is started +STOW_COMPLETE=/home/user/.stow_completed + +if [ $HOME_USER_MOUNTED -eq 0 ] && [ ! -f $STOW_COMPLETE ]; then # Create symbolic links from /home/tooling/ -> /home/user/ stow . -t /home/user/ -d /home/tooling/ --no-folding -v 2 > /tmp/stow.log 2>&1 # Vim does not permit .viminfo to be a symbolic link for security reasons, so manually copy it cp /home/tooling/.viminfo /home/user/.viminfo + touch $STOW_COMPLETE fi exec "$@"