Files
rustdesk/src
Tigah 311d4708e5 fix(linux): reap a crashed headless session's leftovers on next start (#15348)
The teardown cleanup added for #15183 only runs on a clean disconnect.
If the service or its --server crashes before then, the headless logind
session scope and the /tmp/.X<n> lock files it created leak the same way
#15183 leaked them, with nothing to reclaim them afterwards.

Record the session scope and display when the headless session starts,
and on the next --server start reap exactly what the previous run
recorded, then drop the marker. It only ever touches the one scope and
display the previous run recorded, never a scan, so unrelated sessions
are untouched; the reap and X cleanup reuse the teardown path.

A logind session id is only unique within a boot: the counter lives in
/run and resets, so a recorded "session-N.scope" can name a different,
live session after a reboot. Tag the marker with the boot id and only
reap the scope when it matches the current boot. A leaked cgroup cannot
outlive a reboot, so nothing legitimate is lost cross-boot; the X lock
cleanup stays pid-guarded and runs either way.

Signed-off-by: TBX3D <88289044+TBX3D@users.noreply.github.com>
2026-06-21 16:56:41 +08:00
..
2026-04-03 23:13:05 +08:00
2026-04-03 23:13:05 +08:00
2026-04-03 23:13:05 +08:00
2026-05-26 11:11:25 +08:00
2025-06-13 00:30:21 +08:00
2026-01-09 10:03:14 +08:00
2025-11-10 15:43:46 +08:00
2024-04-25 11:46:21 +08:00
2025-01-01 23:11:38 +08:00
2026-05-06 19:27:56 +08:00