Can a single unix domain socket connect to multiple peers simultaneously?
2
votes
1
answer
1663
views
Since this is the socket that
syslog
's /dev/log
is symlinked to, I expect there is at least one listening socket from systemd-journald
, and possibly some additional connected ones, with different "port" numbers. /run/systemd/journal/stdout
does just that.
Listening socket:
# ss -xpl | grep stdout
u_str LISTEN 0 4096 /run/systemd/journal/stdout 15240 * 0 users:(("systemd-journal",pid=254,fd=5),("systemd",pid=1,fd=38))
Connected pair example:
# ss -xp | grep 19637
u_str ESTAB 0 0 * 20872 * 19637 users:(("dbus-daemon",pid=701,fd=2),("dbus-daemon",pid=701,fd=1))
u_str ESTAB 0 0 /run/systemd/journal/stdout 19637 * 20872 users:(("systemd-journal",pid=254,fd=73),("systemd",pid=1,fd=78))
However for dev-log
, it seems that there is no listening socket. A single socket("port"=15236) from systemd-journald is connected to multiple peers, and then in its own record, the socket is shown as ESTAB, with the peer "port" shown as 0. How is that possible? Does the unix socket operates fundamentally different in that aspect compared to a tcp one?
Maybe I should ask, what does a port number in ss
output mean for a unix domain socket?
# ss -xpl | grep dev-log
# ss -xp | grep dev-log
u_dgr ESTAB 0 0 /run/systemd/journal/dev-log 15236 * 0 users:(("systemd-journal",pid=254,fd=3),("systemd",pid=1,fd=36))
# ss -xp | grep 15236
u_dgr ESTAB 0 0 /run/systemd/journal/dev-log 15236 * 0 users:(("systemd-journal",pid=254,fd=3),("systemd",pid=1,fd=36))
u_dgr ESTAB 0 0 * 19250 * 15236 users:(("dbus-daemon",pid=369,fd=14))
u_dgr ESTAB 0 0 * 101364 * 15236 users:(("su",pid=4448,fd=3))
u_dgr ESTAB 0 0 * 22068 * 15236 users:(("gdm",pid=373,fd=13))
u_dgr ESTAB 0 0 * 20801 * 15236 users:(("(sd-pam",pid=692,fd=8))
u_dgr ESTAB 0 0 * 21686 * 15236 users:(("dbus-daemon",pid=701,fd=10))
u_dgr ESTAB 0 0 * 19589 * 15236 users:(("gdm-session-wor",pid=680,fd=9))
u_dgr ESTAB 0 0 * 104580 * 15236 users:(("sudo",pid=4447,fd=8))
u_dgr ESTAB 0 0 * 14305 * 15236 users:(("polkitd",pid=450,fd=10))
u_dgr ESTAB 0 0 * 23001 * 15236 users:(("gnome-session-b",pid=727,fd=17))
Asked by QnA
(605 rep)
Jul 6, 2022, 02:02 AM
Last activity: Jul 6, 2022, 04:06 PM
Last activity: Jul 6, 2022, 04:06 PM