|
| 1 | +# Logout, with and without linger |
| 2 | + |
| 3 | +`install.sh` ends by saying that the services stop at logout unless |
| 4 | +`loginctl enable-linger` is set. It has said that since the first Linux install |
| 5 | +and nobody had tested it, which made it the last documented claim on this |
| 6 | +project resting on nothing but systemd's manual page. |
| 7 | + |
| 8 | +Run on 2026-08-21 at `8bd46ad`, unmodified, in a throwaway Fedora 44 container |
| 9 | +with systemd as PID 1 and no linger enabled by construction, which is the one |
| 10 | +difference from the host the earlier Linux runs used. |
| 11 | + |
| 12 | +## Both halves |
| 13 | + |
| 14 | +A real logind session was opened with `machinectl shell`, all three units |
| 15 | +started inside it, and the **session** closed. The claim holds in both |
| 16 | +directions: |
| 17 | + |
| 18 | +``` |
| 19 | +Linger=no session closed -> user@1000 inactive |
| 20 | + laneward-db, laneward, laneward-conductor all gone |
| 21 | + no bun processes, /run/user/1000 removed |
| 22 | +
|
| 23 | +Linger=yes session closed -> user@1000 active |
| 24 | + all three units active |
| 25 | + hub answers HTTP 200 with nobody logged in |
| 26 | +``` |
| 27 | + |
| 28 | +The nested database container goes down with the user manager in the first case, |
| 29 | +because Quadlet's unit is a user unit like the others. Nothing survives, and |
| 30 | +nothing is left half-running. |
| 31 | + |
| 32 | +## The trap this run walked into first |
| 33 | + |
| 34 | +The first attempt used `loginctl terminate-user`, and everything stopped **with |
| 35 | +linger enabled**, which read as the claim being false. It is not: `terminate-user` |
| 36 | +ends the user's manager regardless of linger, so it answers a different question |
| 37 | +than a logout does. Only `terminate-session` reproduces what a person leaving |
| 38 | +their desk does. |
| 39 | + |
| 40 | +That is worth knowing beyond this run. An operator who tests their own linger |
| 41 | +setup with `terminate-user`, or a session manager that calls it, will conclude |
| 42 | +that linger does not work. |
| 43 | + |
| 44 | +## The stop is clean |
| 45 | + |
| 46 | +At logout the conductor received `SIGTERM` and logged its hand-back line before |
| 47 | +the unit stopped: |
| 48 | + |
| 49 | +``` |
| 50 | +SIGTERM received - stopping 0 running lane(s) |
| 51 | +Stopped laneward-conductor.service - Laneward conductor. |
| 52 | +``` |
| 53 | + |
| 54 | +Zero lanes were running, so this does not establish that a lane in flight is |
| 55 | +handed back at logout; it establishes that the same shutdown path D-014 observed |
| 56 | +under an explicit `systemctl --user stop` is the one a logout takes. |
| 57 | + |
| 58 | +One cosmetic thing to expect in the journal, since it looks worse than it is: |
| 59 | + |
| 60 | +``` |
| 61 | +bun: error: script "start" was terminated by signal SIGTERM (Polite quit request) |
| 62 | +``` |
| 63 | + |
| 64 | +That is bun's run-script wrapper reporting how its child ended, not a failure of |
| 65 | +the unit. |
| 66 | + |
| 67 | +## What this does not establish |
| 68 | + |
| 69 | +- **A lane in flight at logout.** Nothing was running. |
| 70 | +- **A cold boot.** Neither platform has been rebooted. Windows still has that |
| 71 | + half of the item ([the logon trigger run](2026-08-20-windows-logon-trigger.md) |
| 72 | + was a logoff and logon, not a boot). |
| 73 | +- **Bare metal.** Same caveat as every Linux run here: real systemd, real |
| 74 | + podman, shared kernel. |
| 75 | + |
| 76 | +## Cleaned up |
| 77 | + |
| 78 | +The container and its image were removed. Linger was enabled and disabled inside |
| 79 | +that container only; nothing on the Podman machine or the Windows host was |
| 80 | +changed. |
0 commit comments