diff --git a/core/archipelago/src/api/rpc/system/handlers.rs b/core/archipelago/src/api/rpc/system/handlers.rs index 7c4e3a4d..1ac91390 100644 --- a/core/archipelago/src/api/rpc/system/handlers.rs +++ b/core/archipelago/src/api/rpc/system/handlers.rs @@ -402,6 +402,16 @@ async fn sync_hostname_side_effects(hostname: &str) { Err(e) => warn!("/etc/hosts hostname sync failed: {}", e), } + // The kiosk Chromium's profile lock is a symlink encoding -; + // after a rename the stale lock reads as "another computer" holding the + // profile, Chromium refuses to start (--noerrdialogs hides the dialog), and + // the kiosk black-screens on the next boot (#98). Clear it here — Chromium + // recreates the files on launch, and the kiosk launcher pkills any running + // instance before starting a new one. + for f in ["SingletonLock", "SingletonCookie", "SingletonSocket"] { + let _ = tokio::fs::remove_file(format!("/var/lib/archipelago/chromium-kiosk/{f}")).await; + } + let republished = tokio::process::Command::new("/usr/bin/sudo") .args(["-n", "/usr/bin/avahi-set-host-name", hostname]) .output() diff --git a/image-recipe/configs/archipelago-kiosk-launcher.sh b/image-recipe/configs/archipelago-kiosk-launcher.sh index 682e271f..e39f502e 100644 --- a/image-recipe/configs/archipelago-kiosk-launcher.sh +++ b/image-recipe/configs/archipelago-kiosk-launcher.sh @@ -106,6 +106,12 @@ fi ARCHIPELAGO_UID=$(id -u archipelago) while true; do + # A profile lock left by a previous boot encodes -; after a + # hostname change (node rename) Chromium reads it as another computer + # holding the profile and refuses to start — with --noerrdialogs that is an + # invisible failure and the kiosk black-screens forever. Any Chromium that + # owned the lock is dead by now (pkill above / previous loop iteration). + rm -f /var/lib/archipelago/chromium-kiosk/Singleton{Lock,Cookie,Socket} # XDG_RUNTIME_DIR must be passed explicitly — without it Chromium's audio # backend can't find PipeWire-Pulse's socket at /run/user//pulse/native, # falls back to raw ALSA "default", fails to connect, and produces no audio