Closed danclimasevschi closed 2 years ago
@danclimasevschi haven't run into that yet! I am assuming that the xserver didn't have time to cleanup before the container was shut down (only a guess).
That fix looks solid, I will get it merged today! Thank you!
It looks the bash style string substitution doesn’t work. Needs to be replaced with something like this:
result=$(echo "$firstString" | sed "s/Suzi/$secondString/")
@nucleardreamer This solution fixes the problem, here's the patchfile:
From 8a3d53ce3f120f7f567cd9c96bea294147b880b0 Mon Sep 17 00:00:00 2001
From: Dan Climasevschi <dan.climasevschi@ledcity.ch>
Date: Fri, 6 May 2022 08:51:17 +0200
Subject: [PATCH] Fixes #16
---
src/entry.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/entry.sh b/src/entry.sh
index 9501a3f..1509a6e 100644
--- a/src/entry.sh
+++ b/src/entry.sh
@@ -7,6 +7,13 @@ rm -r /tmp/.X11-unix 2>/dev/null
echo "Setting initial display to FORCE_DISPLAY - $FORCE_DISPLAY"
+DISP_NUM=$(echo "$FORCE_DISPLAY" | sed "s/://")
+LOCK_FILE="/tmp/.X${DISP_NUM}-lock"
+if [ -f "$LOCK_FILE" ]; then
+ echo "Removing lockfile $LOCK_FILE"
+ rm -f "$LOCK_FILE" &> /dev/null
+fi
+
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
echo "balenaBlocks xserver version: $(cat VERSION)"
--
2.35.1
Hi, I have tried this out on a FinCM3. It seems that sometimes a lockfile is created after a reboot and this prevents the X server to start on
$FORCE_DISPLAY
. The container then gets stuck in a restart loop with the same logs:I would propose this fix for the
entry.sh
script: https://github.com/balenablocks/xserver/blob/c3acc3e2ed2c3b59abae711a84d6eb1846149ae6/src/entry.sh#L9