Questions tagged [unix-sockets]

124 questions
32
votes
2 answers

Why is socket path length limited to a hundred chars?

On Unix systems path names have usually virtually no length limitation (well, 4096 characters on Linux)... except for socket files paths which are limited to around 100 characters (107 characters on Linux). First question: why such a low…
WhiteWinterWolf
  • 2,851
  • 2
  • 21
  • 37
23
votes
2 answers

How to passively capture from Unix domain sockets (AF_UNIX socket monitoring)?

TCP/IP and UDP captures can be made using tcpdump/dumpcap and produces a pcap/pcapng file which can be fed to Wireshark for further analysis. Does a similar tool exist for named Unix domain sockets? (A general solution that works for abstract…
Lekensteyn
  • 20,173
  • 18
  • 71
  • 111
23
votes
1 answer

What happens with unix stream ancillary data on partial reads?

So I've read lots of information on unix-stream ancillary data, but one thing missing from all the documentation is what is supposed to happen when there is a partial read? Suppose I'm receiving the following messages into a 24 byte buffer msg1 [20…
M Conrad
  • 963
  • 4
  • 13
19
votes
1 answer

What does x (execute) permission do on unix sockets?

By my experience unprivileged user can not access unix socket he/she does not own without x bit set. What does this bit do exactly?
19
votes
2 answers

Can't start applications due to "Maximum number of clients reached" error

After some period of time, I'm experiencing problems with starting applications, for example, Viber. $ /opt/viber/Viber QSqlDatabasePrivate::removeDatabase: connection 'ConfigureDBConnection' is still in use, all queries will cease to work. Maximum…
humkins
  • 1,137
  • 4
  • 14
  • 26
16
votes
2 answers

Does Linux automatically clean up abstract domain sockets?

There's a great answer on StackOverflow about providing a better lock for daemons (synthesized from Eduardo Fleury) that doesn't depend on the common PID file lock mechanism for daemons. There are lots of good comments there about why PID lock files…
CivFan
  • 457
  • 7
  • 15
14
votes
1 answer

What is the meaning of the contents of /proc/net/unix?

On my Android device there is the file called /proc/net/unix who's content does not conform to that of any standard linux distribution (which show the unix domain sockets.) First few lines: Num RefCount Protocol Flags Type St Inode…
not2qubit
  • 1,578
  • 1
  • 20
  • 21
11
votes
3 answers

SSH connect to a UNIX socket instead of hostname

Short question: How do I connect to a local unix socket (~/test.sock) via ssh? This sockets forwards to an actual ssh server. The obvious does not work and I can't find any documentation: public> ssh /home/username/test.sock "ssh: Could not resolve…
bvolkmer
  • 409
  • 1
  • 3
  • 9
11
votes
1 answer

What values may Linux use for the default unix socket buffer size?

Linux documents the default buffer size for tcp, but not for AF_UNIX ("local") sockets. The value can be read (or written) at runtime. cat /proc/sys/net/core/[rw]mem_default Is this value always set the same across different Linux kernels, or is…
sourcejedi
  • 48,311
  • 17
  • 143
  • 296
11
votes
3 answers

Connect with D-Bus in a network namespace

I am using network namespaces such that I can capture network traffic of a single process. The namespace is connected through the "host" via a veth pair and has network connectivity through NAT. So far this works for IP traffic and named Unix domain…
Lekensteyn
  • 20,173
  • 18
  • 71
  • 111
10
votes
1 answer

Concurrently reading/writing to the same unix socket?

Is it OK for two or more processes concurrently read/write to the same unix socket? I've done some testing. Here's my sock_test.sh, which spawns 50 clients each of which concurrently write 5K messages: #! /bin/bash…
NarūnasK
  • 2,276
  • 4
  • 25
  • 35
10
votes
1 answer

Why is there AF_NETLINK? Is AF_UNIX not enough?

As far as I understand, AF_NETLINK socket protocol is for communicating between the kernel and userspace and AF_UNIX is for communication between two userspace processes. Why does Linux need a separate AF_NETLINK? Why UNIX sockets cannot be used for…
Vi.
  • 5,528
  • 7
  • 34
  • 68
9
votes
1 answer

OpenSSH not cleaning up the domain socket upon termination

I have a local unix socket tunneled to another unix socket on a remote instance over SSH: ssh -N -L $HOME/my.sock:/var/run/another.sock however, when I terminate ssh gracefully (i.e. ctrl+C or SIGTERM), the $HOME/my.sock remains. It looks like this…
ahmet alp balkan
  • 601
  • 1
  • 8
  • 21
8
votes
1 answer

Display webpage with unix domain socket

Is there a way to serve a webpage from a locally running tcp server listening on a unix domain socket instead of localhost:? something like: file:///tmp/webpage.sock my only real motivation is to avoid port conflicts in the 2000-5000 range.
Alexander Mills
  • 9,330
  • 19
  • 95
  • 180
7
votes
2 answers

How can I use GPG agent forwarding over ssh when systemd owns the remote sockets?

I'm trying to follow these guides and answers https://wiki.gnupg.org/AgentForwarding https://superuser.com/questions/161973/how-can-i-forward-a-gpg-key-via-ssh-agent https://gist.github.com/TimJDFletcher/85fafd023c81aabfad57454111c1564d and…
oarfish
  • 374
  • 2
  • 20
1
2 3
8 9