Notes socket Unix

Voir :

Postgres - se connecter a une socket

https://kohlschutter.github.io/junixsocket/unixsockets.html

netstat -ln | grep mysql ss -x netstat --unix cat /proc/net/unix

Connect to an existing stream socket

nc -U /path/to/socket

Create a listening stream socket

nc -lU /path/to/socket

# lsof -U -a -p $(pidof mysqld)
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 1766 mysql 18u unix 0xffffa0c0b6f97800 0t0 26264 /var/run/mysqld/mysqld.sock type=STREAM

sudo curl -v --unix-socket /var/run/crio/crio.sock http://localhost/info | jq

Podman

$ sudo curl -H "Content-Type: application/json" --unix-socket /var/run/docker.sock http://localhost/_ping
OK

Unit socket SystemD

Voir :

https://mgdm.net/weblog/systemd-socket-activation/