5.0 KiB
Unraid Docker console and root runtime directory · 20 October 2026
Current status: REVERTED at the user's request
The user rejected this non-GUI workaround. Removed the exact added go block;
the resulting file SHA256 matches the original byte-for-byte:
88929984a9e131f02ea90d4577e2dd7afbafd6adc4947714c215081caefdce84.
Ran loginctl disable-linger root; verified Linger=no and no root linger
marker. All running container IDs and StartedAt values stayed unchanged;
dockerd PID remained 77037. No Docker/container restart.
The earlier sections below are historical diagnosis, not an active deployment or an approved installation recipe. Do not reapply the lingering workaround. The original logout-triggered console failure can recur.
User constraint for Unraid host administration: only normal GUI-exposed settings and manufacturer-provided operation are acceptable. No custom startup-script workarounds or hidden host changes. The pre-existing unrelated go content was preserved; this rollback restores the state before this console workaround, not an assertion that the entire host is factory-default.
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:
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:
/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:
# 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:
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/