CRIU supports checkpointing and restoring Unix domain sockets (AF_UNIX), including Stream, Datagram, and Sequential Packet types. Unix sockets are unique because they can be bound to paths in the filesystem and are frequently used to transfer file descriptors between processes.
bind(), the socket still reports its original address.SCM_RIGHTS that have been sent by one process but not yet received by the peer.SIOCUNIXFILETo reliably restore Unix sockets, CRIU developers upstreamed the SIOCUNIXFILE ioctl to the Linux kernel. This ioctl allows CRIU to:
O_PATH file descriptor to the actual socket file on disk, regardless of its current name or overmounting status in the filesystem.O_PATH descriptor, CRIU can definitively identify the exact mount point and inode of the socket file, ensuring it can be recreated in the correct location during restoration.sock_diag netlink interface to retrieve the socket’s type, state, and peer ID.socketpair()), CRIU uses the peer information to link them together in the process tree model.SIOCUNIXFILE to get a handle to the socket file and records its location.tmpfs mount) to safely recreate socket files without interfering with the host filesystem.bind() call targets the correct path.bind() and listen(), while the other calls connect(). CRIU’s file restoration engine coordinates this to ensure the server end is ready before the client attempts to connect.SCM_RIGHTS mechanism, ensuring the application receives them upon resumption.If a socket is connected to a process outside the tree being checkpointed, CRIU cannot capture the peer’s state. These are External Sockets.
--external unix[ID] option, which tells CRIU to treat the socket as a persistent external dependency.