Document persistent Unraid console fix with verified logout reproduction

This commit is contained in:
Mikei386 committed 2026-10-20 11:58:08 +02:00
1 parent 38d07adaca
commit 90acf1679b
2 files changed
+105

No files matched your search

+9
View File
@@ -1,3 +1,12 @@
## Unraid Docker console · 20 October 2026
Root's runtime directory was removed by elogind after logout while Docker retained
XDG_RUNTIME_DIR=/run/user/0. Reproduced exact runc console error without active
login; fixed using built-in root lingering, persisted through Unraid config/go.
Post-logout TTY succeeds; all running container IDs/start times and dockerd PID
unchanged. No host reboot performed.
[Diagnosis, persistence and rollback](maintenance/2026-10-20-unraid-docker-console.md).
## RAM upgrade · 20 October 2026
Athena now reports MemTotal 65,730,108 KiB (about 62.7 GiB usable, 64 GB
@@ -0,0 +1,96 @@
# Unraid Docker console and root runtime directory · 20 October 2026
Host: HomeServer, Unraid 7.3.3, elogind 257.16. This is an Unraid host fix,
not an Athena Deck/model/container image change.
## Cause and controlled reproduction
Both existing dockerd and containerd inherited `XDG_RUNTIME_DIR=/run/user/0`.
Root had `Linger=no`; PAM login/sshd uses pam_elogind. Elogind owns the user
runtime directory and removes it after the last session closes. The still-running
Docker stack retains the path, so non-TTY exec works but TTY creation can fail:
```text
failed to create runc console socket: stat /run/user/0: no such file or directory
```
SSH multiplexing initially concealed the failure: local ControlPersist=600 kept
the diagnostic login alive after commands returned. A one-shot atd probe slept
20 seconds and then tested the directory and `docker exec -t ... /bin/bash`.
After explicitly closing our own SSH master, the probe recorded no login
sessions, a missing directory and the exact console-socket error (exit 127).
No directories were deleted manually and no user sessions were terminated.
## Correction
Use the session manager's built-in lingering facility:
```sh
/usr/bin/loginctl enable-linger root
```
Live verification: `Linger=yes`, marker `/var/lib/elogind/linger/root` present;
runtime directory `/run/user/0` owned by root with mode 0700. This does not
change SSH authentication or add an agent/server/watchdog.
Unraid's RAM-root state is recreated on boot. Therefore the existing persistent
`/boot/config/go` now contains the following immediately before emhttp starts:
```sh
# Keep root runtime state available for Docker consoles after logout.
/usr/bin/loginctl enable-linger root || /usr/bin/logger -t docker-console "Could not enable root linger"
```
Other go content was preserved byte-for-byte. Original SHA256:
`88929984a9e131f02ea90d4577e2dd7afbafd6adc4947714c215081caefdce84`.
Updated SHA256:
`083eb52ff252e1ec6a5d2735feea84f852d08a551805eee926b359a5e362e59e`.
The staged file passed `bash -n`, hashes were checked before replacement,
mode 0600 preserved, and the resulting file synced to the boot device.
The go file was **not executed wholesale**: it also starts management services
and applies existing firewall rules. Only loginctl was invoked live.
## Verified after logout
The same one-shot probe was repeated after closing our SSH master again:
```text
SESSIONS
DIRECTORY
700 root /run/user/0
TTY
TTY_OK
tty_exit=0
```
The empty SESSIONS section confirms no login session was holding the directory
open. Before/after sorted snapshots of all running container IDs and StartedAt
values are identical. Dockerd PID remained 77037. No running container or Docker
daemon was stopped/restarted. The two one-shot atd probes completed; queue empty.
Local evidence and original/updated go copies are under
`work/unraid-console-20261020/`, outside Git.
## Persistence, restore and rollback
Keep `/boot/config/go` in the normal Unraid boot-device backup. A new Unraid
installation needs this one loginctl line before management/Docker starts, with
its normal elogind installed and available. No modified rc.d vendor scripts,
new packages, periodic jobs or container image changes are required.
For rollback, remove only the added comment/loginctl line from go. Disabling
root lingering live can restore the original console failure after logout;
do that only after Docker no longer depends on this user runtime path.
A full host reboot is intentionally outside acceptance because the user requires
running containers to remain uninterrupted. Boot persistence is configured and
syntax-checked; a reboot acceptance remains unperformed.
## Primary sources
- Elogind source: runtime directory removal and linger guard:
https://github.com/elogind/elogind/blob/main/src/login/logind-user.c
- Installed-version loginctl implementation:
https://github.com/elogind/elogind/blob/v257.16/src/login/loginctl.c
- Unraid's documented boot customization point:
https://docs.unraid.net/unraid-os/troubleshooting/common-issues/boot-and-startup-failures/