Files
Athena-Deck/docs/maintenance/2026-10-20-unraid-docker-console.md

9.2 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.

Read-only trigger analysis later on 20 October

Host boot: 9 October 11:15:54 CEST. The rotated syslog records normal emhttpd Docker startup at 11:18:59, then a separate Docker stop at 11:32:06 and start at 11:32:20. The currently running dockerd PID 77037 started at 11:32:19 and containerd PID 77055 at 11:32:20; both still carry XDG_SESSION_ID=1 and XDG_RUNTIME_DIR=/run/user/0. Dockerd also has SSH_CONNECTION set; its value was not disclosed. Emhttpd PID 7304 started at 11:18:40 and has neither of the inspected XDG session variables.

The local maintenance artifact work/docker-recovery-20261009/offline.sh, timestamped 11:31:21 CEST, ends by invoking /etc/rc.d/rc.docker start directly. It was a container-metadata recovery script, not a Hermes installation script. The corresponding root SSH session opened at 11:23:20 and closed at 13:03:49. The rc.docker start implementation passes its caller's environment through nohup/unshare to dockerd without clearing these session variables.

Conclusion: the daemon's SSH/session origin is directly observed. The exact timestamp/script/log correlation strongly implicates our 9 October recovery operation as the trigger. There is no per-command execution audit proving that particular local script was the process that invoked start, so this last attribution remains a strong inference, not a captured parent-process trace. This evidence does not establish a newly introduced Hermes or Unraid upgrade bug.

The appropriate next operational test is a planned stop/start through the normal Unraid Docker GUI, followed by verifying the daemon environment and a console after all SSH logouts. Emhttpd's clean inspected environment makes that a reasonable expected remedy, but it has not yet been performed/qualified. No changes or service/container restarts occurred during this follow-up analysis.

Read-only reboot preflight

Checked later on 20 October without reboot or host configuration changes:

  • /boot/config/go parses with bash -n and contains no lingering workaround.
  • startArray=yes; DOCKER_ENABLED=yes; Docker uses folder mode.
  • /var/lib/docker resides on persistent nvme-storage/system ZFS, not a RAM overlay for container records; no separate /var/lib/docker/containers mount.
  • nvme-storage pool ONLINE; boot device about 12% used.
  • Hermes /opt/data is a persistent bind from /mnt/nvme-storage/appdata/Hermes-Agent-Desktop.
  • Running emhttpd has none of the inspected SSH/session runtime environment variables. This supports expecting normal GUI/boot Docker startup to avoid the inherited SSH environment, but a post-boot test is still required.
  • Searched persistent user scripts and plugin shell/PLG files for rc.docker and Docker-container tmpfs overlays; no boot reintroduction found in that search scope. viewDockerLogSize only reads disk usage; no mounts.

The canonical startup list is /var/lib/docker/unraid-autostart, as read by rc.docker (not the initially guessed DockerMan autostart.cfg path). Eight currently running containers are absent from that list and lack an always policy:

Container Docker restart policy
Paperless-NGX no
Radarr no
Hermes-Agent-Desktop unless-stopped
Nginx-Proxy-Manager-MCP unless-stopped
SABnzbd no
Sonarr no
Ownfoil no
OpenCode no

The six policy=no entries have no identified automatic startup route in the checked standard Docker mechanisms. Do not silently enable them: some services may intentionally be started on demand. The two unless-stopped entries are also not a guaranteed substitute for Unraid autostart: current rc.docker's docker_container_stop explicitly issues docker stop for running containers. Docker's documented unless-stopped behavior preserves manual stops across daemon restarts. If the user wants these apps on every boot, configure their normal GUI Autostart switches before reboot.

This is not full NAS boot certification. No complete boot archive/vendor-file comparison, real reboot, per-application boot acceptance, VM recovery test or complete plugin audit was performed. No evidence from these checks indicates a general boot/storage collapse; equally, a claim that everything will resume unchanged would be unsupported.

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