Likho User
commited on
Commit
·
eeffe53
1
Parent(s):
e9861d4
Fix: Wait for X server to be ready before starting app
Browse files- scripts/start-desktop.sh +11 -0
scripts/start-desktop.sh
CHANGED
|
@@ -9,6 +9,17 @@ su - vncuser -c "vncserver ${DISPLAY} -geometry 1280x720 -depth 24 -localhost no
|
|
| 9 |
echo "Starting noVNC..."
|
| 10 |
websockify --web=/usr/share/novnc ${NO_VNC_PORT} localhost:${VNC_PORT} &
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# Start App
|
| 13 |
echo "Starting App..."
|
| 14 |
cd /app
|
|
|
|
| 9 |
echo "Starting noVNC..."
|
| 10 |
websockify --web=/usr/share/novnc ${NO_VNC_PORT} localhost:${VNC_PORT} &
|
| 11 |
|
| 12 |
+
# Wait for X server to be ready
|
| 13 |
+
echo "Waiting for X server..."
|
| 14 |
+
for i in {1..30}; do
|
| 15 |
+
if xdotool getdisplaygeometry >/dev/null 2>&1; then
|
| 16 |
+
echo "X server is ready."
|
| 17 |
+
break
|
| 18 |
+
fi
|
| 19 |
+
echo "Waiting for X server... ($i/30)"
|
| 20 |
+
sleep 1
|
| 21 |
+
done
|
| 22 |
+
|
| 23 |
# Start App
|
| 24 |
echo "Starting App..."
|
| 25 |
cd /app
|