Socket activation starts a service only when a connection arrives on a listening IP or UNIX domain socket. The service may exit while idle, and systemd starts it again for a later connection. section 7.6
Systemd owns the listening socket and hands connections to the activated service. For a containerized service, Podman becomes the intermediary that launches the container and passes the connection into it. section 7.6 section 1.3.7
A typical socket-activated Podman workflow is:
- Stop the service to stop and remove the container; a later connection activates it again. section 7.6
The same design keeps Podman itself non-daemonized. Rootful and rootless podman.socket units listen on their respective UNIX sockets, launch the Podman service for API requests, and allow it to exit after five seconds without activity. section 9.1.1
Enable a rootless Podman socket
systemctl --user enable --now podman.socket ls $XDG_RUNTIME_DIR/podman/podman.sock curl -s --unix-socket $XDG_RUNTIME_DIR/podman/podman.sock http://d/v1.0.0/libpod/version
Figure 7.9 When a connection to the socket systemd is listening on arrives, systemd activates Podman, which launches the container, passing the socket down to the container.
Trace the activation boundary from systemd's listening socket through Podman to the container handling the connection. section 7.6
