liveBook · Manning

Podman.socket

As explained in Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

podman.socket is a systemd socket unit that listens for Podman service connections and activates the corresponding service.

podman.socket is a systemd socket unit that listens on a UNIX socket and activates Podman’s API service only when a client connects. Podman provides separate units for rootful and rootless operation. section 9.1.1

The activation sequence is:

  • systemd listens on the configured socket while no Podman process is running. section 9.1.1
  • A client connection causes systemd to launch podman system service and hand it the socket. section 9.1.1
  • After completing the API request, Podman waits briefly; it exits after five seconds without another connection. section 9.1.1

Enable a rootless socket

systemctl --user enable --now podman.socket The rootless socket appears beneath XDG_RUNTIME_DIR, such as /run/user/3267/podman/podman.sock. A curl request over that UNIX socket can probe the Podman API version.

Figure 9.1 Podman service running under systemd

Trace how systemd turns an incoming socket connection into an on-demand Podman service process. section 9.1.1

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

How deep it goes
Explains unit modes, socket handoff, idle termination, enablement, and API probing, but not unit-file directives.
Examples
Uses systemctl enablement, XDG_RUNTIME_DIR socket discovery, curl API probing, and remote-server configuration commands.
What it assumes
Assumes Linux systemd and basic Podman usage while distinguishing rootless setup from rootful setup.
What you can do after
Operate/configure rootless or rootful Podman API access through systemd and verify that the socket accepts requests.
How it connects
Connects systemd socket activation, UNIX domain sockets, REST APIs, rootless Podman, SSH, and remote Podman clients.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.