Skip to content

Commit

Permalink
Only execute stow the first time container is started
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Obuchowicz <[email protected]>
  • Loading branch information
AObuchow committed Oct 13, 2023
1 parent 2d481b0 commit ef6f4c3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion universal/ubi8/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"

0 comments on commit ef6f4c3

Please sign in to comment.