Linux: Play from a desktop launcher gets the game killed ~90 s later (systemd stops the launcher's unit when the Builder exits) #2529
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#2529
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why this matters
On a Linux desktop that runs each launcher in its own systemd user service (COSMIC here; GNOME and KDE do the same), clicking Play in the launcher window starts the game and then systemd stops it again. The game window disappears with no message, and
hookshot_log.txtends mid-line with no error. To the player it looks like a silent crash on Play.Hookshot version
v2.1.0 (the AppImage Builder, game built from a
.nup). The code involved is unchanged in v2.1.0-rc.3, the nightly and currentmain.What happened
Started from the desktop entry (
Exec="~/Games/Hookshot/hookshot"), the game is killed after Play. The same launcher run from a plain terminal does not kill it.The cause I found, from the journal and a controlled test:
app-hookshot@<id>.service. The service's main process is the launcher:hookshotscript, thenexecintoHookshot.AppImage --launch <folder>.play_and_close()(builder/linux/hookshot_builder.py). That callsplay(), which starts the game withsubprocess.Popen(..., start_new_session=True), and thenself.destroy(), so the Builder process exits.start_new_sessionleaves the control group, so the game is still in the service's cgroup when its main process exits. systemd then stops the service (KillMode=control-group,TimeoutStopSec=90s) and sends SIGTERM to the game.display: window closed, exitingline. 90 s later systemd sends SIGKILL.Test that shows it
Same launcher, run as a transient user service, with a click on Play in the launcher window:
I sampled the unit every 3 s:
journal:
systemctl --user showfor the unit:Type=simple KillMode=control-group TimeoutStopUSec=1min 30s.The same pattern is in my journal from the earlier failures. Two launches from the desktop icon each ended
State 'stop-sigterm' timed out. Killing.followed byKilling process <pid> (hookshot) with signal SIGKILL, 93 s after start. The game's log in both ends in the middle of the start-up shader precompile with no error (vk: start-up: pipelines 8112 of 13270, 61% of all, about 1 min left). The precompile only looked guilty: it was running when the kill came.What I expected
The game keeps running after Play, as it does from a terminal.
Where in the game
Before the first frame: Play on the launcher window, then the start-up screen.
How often
Every time when the launcher runs in a systemd user service and the Builder window closes on Play. From a terminal it does not happen, so players who launch from a terminal never see it.
Graphics card and driver version
RTX 3070 Ti, NVIDIA 595.104.02 (open kernel module), Vulkan 1.4
CPU, RAM and operating system
i7-12700K, 16 GB, Pop!_OS 24.04 LTS (COSMIC), kernel 7.2.15, systemd 255
Things to check or fix (suggestions, not a patch)
systemd-run --useris available (for examplesystemd-run --user --collect --scope, or a service of its own), so closing the Builder window cannot stop it.Not explained by this
On the first Play click in one session nothing happened, and a second click started the game. No game was started by the first click (the logs did not rotate), so I can't say whether it was a missed click on an unfocused window or something in the Builder. I'd treat it as a separate observation.
hookshot_log.txt
Not attached: the lines that matter are quoted above. I can attach
hookshot_log.1.txtandhookshot_log.2.txtif useful.Before you send it
.bincaches or saves are attached.