v0.5.1 (SESSION-ENV): the unit waits for the login's session environment — an ExecStartPre gate instead of a start before the import #11
Loading…
Reference in a new issue
No description provided.
Delete branch "oss-oo/session-env-gate"
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
At the 2026-10-28 reboot
oo-appserver.service(WantedBy=default.target) started at 11:53:05.3;default.targetwas reached at 11:53:06.5, and the X login'sdbus-update-activation-environment --systemd(/etc/X11/Xsession.d/95dbus_update-activation-env) importedDISPLAY/XAUTHORITY/SSH_AUTH_SOCK/… into the user manager only after that. The shared server therefore ran without the session block until the launcher's one restart;oo-appserver doctorsaidWARN the service lacks session keys this shell has: ['DISPLAY', 'XAUTHORITY'] — started before the login import. Cinnamon never activatesgraphical-session.target(inactive on the station), so no ordering target can fix it. The owner asked for a clean autostart with the system.What
systemd/oo-appserver.service: a secondExecStartPre,libexec/appserver_session_env.py— pollssystemctl --user show-environmentuntilDISPLAYorWAYLAND_DISPLAYis present (bounded 30 s;OO_APPSERVER_SESSION_ENV_TIMEOUT_Svia a drop-in), writes one line to$RUNTIME_DIRECTORY/session-env, never fails the unit (a console or SSH login passes after the bound:not imported within 30s).oo-appserver status: newsessionline (the record /no record — the running unit predates the v0.5.1 gate/unit not running);doctornames the gate record inside the session-keys warning.libexec/appserver_station.py:session_env_record();install.shinstalls the gate; CI runstests/test_session_env.py(8 legs: already imported, import during the wait, timeout, systemctl unavailable, wayland alone, custom keys + result path, no runtime dir, env seam + bad arguments); README Parts row, "The regular flow" step 1 with the measured times, Knobs; VERSION 0.5.1.Evidence (stage: code, tests green locally; live after install)
ExecStartPrewaits for a PRIVATE key (OO_ENVWAIT_TEST) in the manager environment; the key was imported 2 s after the start while the unit wasactivating start-pre;ExecStartprinted the imported value → systemd builds every Exec*'s environment at its own spawn, so a gate in the same unit suffices (no second unit). Two earlier runs were invalid (systemd-runwithout--no-blockreturns only afterExecStartPre), noted as a lesson. Cleanup verified (key unset, unit collected).systemd-analyze --user verifyof the four units rc 0;install.sh --checklists the gate;oo-appserver statusfrom the worktree showssession : no record — the running unit predates the v0.5.1 gate.Validation after merge
Install from the tag,
oo-appserver restartwhile no client, no loaded thread and the app not attached →statusshowssession : already imported · keys DISPLAY,XAUTHORITY,…anddoctorhas no session-keys WARN; the next reboot shows the gate's line in the journal beforeStarted oo-appserver.service, without any restart.Review: independent read-only review before the merge (fleet law); findings are fixed here first.
🤖 Generated with Claude Code