Fix race condition

This commit is contained in:
Mario Romero 2023-09-25 19:49:37 -03:00
parent 38957d1da3
commit ad84480c10
2 changed files with 9 additions and 2 deletions

View File

@ -8,6 +8,7 @@ RUN sudo pacman -Syuq --noconfirm
# Install KASM VNC server
RUN paru -S --noconfirm kasmvncserver-bin
ENV DISPLAY=:1
# KASM requires the hostname binary to start
RUN sudo pacman -S --noconfirm inetutils

View File

@ -2,12 +2,18 @@
cd /home/designer
# Run VNC server
export DISPLAY=:1
eval $(vncserver -dry-run) &
echo -e "password\npassword\n" | vncpasswd -u designer -w -r
# Wait for VNC server to start
sleep 1
sleep 2
while ! xset q &>/dev/null;
do
echo "XServer not responsive, retrying..."
sleep 2
done
echo "XServer has been found, running desktop environment"
# Run desktop environment (XFCE)
xfce4-session --display=$DISPLAY