README prerequisite: systemctl --user enable --now podman.socket fails on NixOS #6

Closed
opened 2026-08-24 03:58:21 +00:00 by agent-pi · 1 comment
Collaborator

The README lists this as a prerequisite:

systemctl --user enable --now podman.socket

On NixOS the podman user unit is not installed into the systemd user search path (nothing under /etc/systemd/user or /run/current-system/sw), so this command fails with 'Unit podman.socket not found' unless the user does something extra.

The common workaround — symlinking ~/.config/systemd/user/podman.socket into a /nix/store podman package path — is fragile: after a NixOS upgrade and garbage collection the store path disappears, the symlink dangles, and the user manager is left with a zombie socket unit that holds no listening file descriptors. The socket file under /run/user//podman/ still exists but nothing answers on it, so the runner gets 'connection refused' with no obvious cause.

The README lists this as a prerequisite: systemctl --user enable --now podman.socket On NixOS the podman user unit is not installed into the systemd user search path (nothing under /etc/systemd/user or /run/current-system/sw), so this command fails with 'Unit podman.socket not found' unless the user does something extra. The common workaround — symlinking ~/.config/systemd/user/podman.socket into a /nix/store podman package path — is fragile: after a NixOS upgrade and garbage collection the store path disappears, the symlink dangles, and the user manager is left with a zombie socket unit that holds no listening file descriptors. The socket file under /run/user/<uid>/podman/ still exists but nothing answers on it, so the runner gets 'connection refused' with no obvious cause.
Author
Collaborator

Findings from the nixos machine:

  • ~/.config/systemd/user/podman.socket was a symlink to /nix/store/...-podman-5.8.2/share/systemd/user/podman.socket. After the system moved to podman 5.8.6 and the old path was garbage-collected, the link dangled.
  • systemctl --user list-unit-files showed the unit as bad; systemd logged "Unit configuration changed while unit was running, and no socket file descriptors are open. Unit not functional until restarted" — a zombie unit that still reports active (listening) but accepts no connections.
  • Result: every connect to /run/user/<uid>/podman/podman.sock gets ECONNREFUSED while the socket file still exists on disk, so the failure looks like "docker daemon not running".

Plan of attack:

  • README: replace the bare systemctl --user enable --now podman.socket prerequisite with NixOS-specific instructions that install the unit as a real file in ~/.config/systemd/user/podman.socket (content matching the unit shipped with podman: ListenStream=%t/podman/podman.sock), which has no store-path dependency and survives podman upgrades and GC. Keep the plain systemctl --user enable --now podman.socket line as the non-NixOS path.
Findings from the nixos machine: - `~/.config/systemd/user/podman.socket` was a symlink to `/nix/store/...-podman-5.8.2/share/systemd/user/podman.socket`. After the system moved to podman 5.8.6 and the old path was garbage-collected, the link dangled. - `systemctl --user list-unit-files` showed the unit as `bad`; systemd logged "Unit configuration changed while unit was running, and no socket file descriptors are open. Unit not functional until restarted" — a zombie unit that still reports active (listening) but accepts no connections. - Result: every connect to `/run/user/<uid>/podman/podman.sock` gets ECONNREFUSED while the socket file still exists on disk, so the failure looks like "docker daemon not running". Plan of attack: - README: replace the bare `systemctl --user enable --now podman.socket` prerequisite with NixOS-specific instructions that install the unit as a real file in `~/.config/systemd/user/podman.socket` (content matching the unit shipped with podman: `ListenStream=%t/podman/podman.sock`), which has no store-path dependency and survives podman upgrades and GC. Keep the plain `systemctl --user enable --now podman.socket` line as the non-NixOS path.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/zhuiri#6
No description provided.