Skip to content

Commit e144b82

Browse files
committed
docs(notes): measure what logout does, with and without linger
install.sh has always ended by saying the services stop at logout unless linger is enabled. It now says something that was tested: closing the session takes down all three units and the nested database with them, and leaves every one of them running when linger is set. The first attempt read as a refutation because it used terminate-user, which ends the user manager whatever linger says. Only terminate-session asks the question a person leaving their desk asks, and anyone checking their own setup the other way will conclude linger is broken.
1 parent 8bd46ad commit e144b82

2 files changed

Lines changed: 91 additions & 5 deletions

File tree

docs/notes/2026-08-19-what-is-left.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,17 @@ agent once it arrived. It also found that `install.ps1` had been registering
5353
only the conductor and never the hub, which would have left a first-time
5454
Windows user with a task reporting `Running` and a dashboard that never loads.
5555

56-
**Reboot survival, and logout on Linux.** A logoff and logon is not a cold boot,
57-
so Windows still has a reboot to survive. On Linux `WantedBy=default.target`
58-
stops at logout unless `loginctl enable-linger` is set, which the installer says
59-
and nobody has tested. Linger is a persistent host change and needs its own
60-
approval, which is why the installer will not do it on your behalf.
56+
~~**Logout on Linux.**~~ **Done 2026-08-21**
57+
([evidence](2026-08-21-logout-and-linger.md)). Closing the session stops every
58+
unit without linger and leaves all three running with it, which is exactly what
59+
`install.sh` claims. It also found that `loginctl terminate-user` ends the user
60+
manager whatever linger says, so anyone testing their own setup that way will
61+
conclude linger is broken. Linger stays a persistent host change the installer
62+
will not make on your behalf.
63+
64+
**Reboot survival on Windows.** A logoff and logon is not a cold boot, so
65+
Windows still has a reboot to survive. It needs a real restart of the machine,
66+
which is the operator's to give.
6167

6268
Note that nothing starts the Podman machine at logon, and nothing here should:
6369
it is a machine-wide service rather than Laneward's to register. Both platforms
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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

Comments
 (0)