Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [unix-sockets]

The tag has no usage guidance.

18
votes
2answers
3k views

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 ...
17
votes
1answer
762 views

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 ...
14
votes
2answers
4k views

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 ...
11
votes
2answers
13k views

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? (...
8
votes
1answer
2k views

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? Thanks
7
votes
1answer
3k views

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 ...
7
votes
1answer
3k views

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 ...
7
votes
1answer
3k views

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 ...
6
votes
3answers
814 views

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 ...
5
votes
1answer
3k views

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 ...
5
votes
1answer
302 views

How can I sniff unix dgram socket without having file path?

From that article, I realized that: a UNIX domain socket is bound to a file path. So, I need to sniff DGRAM Unix socket through the socat as mentioned here. But when I try to retrieve the path for ...
4
votes
1answer
2k views

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> ...
4
votes
2answers
165 views

Unix Domain Socket bind, reuse address

If I bind() an AF_INET socket (for a TCP connection), then later close() it, next time I run my program, I may have issues, since despite the close(), the kernel can still have the resources ...
4
votes
1answer
221 views

Forward abstract unix socket over SSH?

I've discovered that OpenSSH is capable of forwarding UNIX sockets like this: ssh -R /var/run/program.sock:/var/run/program.sock My question is whether this extends to abstract unix sockets too. I'...
4
votes
1answer
155 views

How to prevent a process from writing to the systemd journal?

I am using a third party .NET Core application (a binary distribution used by a VS Code extension) that unfortunately has diagnostic logging enabled with no apparent way to disable it (I did already ...
3
votes
1answer
4k views

Differences between Unix Domain Sockets and Network Sockets?

Am I right that When two processes communicate by network sockets, each process create a socket (each socket belongs to one process), and the processes communicate by their sockets. When two ...
3
votes
1answer
4k views

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 ...
3
votes
1answer
643 views

Building a Unix socket bridge via TCP

I have two processes (Client and server) that communicate with each other using a Unix socket /tmp/tm.ipc. Both processes (Client and Server) don't support TCP. Client -> /tmp/tm.ipc -> Server Now, ...
3
votes
1answer
3k views

How to report receive queue size for AF_UNIX sockets

netstat -a reports Recv-Q (amount of unread data pending for a reading application) for AF_INET sockets, but not AF_UNIX sockets (at least not for SOCK_DGRAM). Does anybody know a way to obtain this ...
3
votes
1answer
455 views

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 ...
3
votes
1answer
3k views

How can a service with PrivateTmp=true access a unix socket in the /tmp directory (e.g. to submit Torque jobs from PHP running in Apache)

We have a webserver that performs scientific calculations submitted by users. The calculations can be long-running, so we use The Torque resource manager (aka pbs_server) to distribute/schedule them ...
3
votes
1answer
4k views

Do UNIX Domain Sockets Overflow?

When you create a UNIX socket using socat and send data to it, but do not have another socat instance connecting to that socket, what will happen then? What happens if you write massive amounts of ...
3
votes
1answer
442 views

How does Node.js / the cluster module pass new connections from the master / parent process, to child processes?

How exactly does this work under the hood / at the OS level (primarily in Unix implementations / from the perspective of the sockets API)? The cluster module documentation says: "the master process ...
3
votes
1answer
2k views

ssh on unix socket

I have some old unix running as vm on VirtualBox server those vm had the serial ports simulated by unix socket for example: an old AT&T 2.1 SVr4 has socket on /tmp/att1 to connect i did minicom -...
3
votes
1answer
2k views

nginx errors with failed (13: permission denied) for socket despite socket permissions being set to 777

I've set permissions on the socket to 777 yet Nginx keeps stating that it's being denied permission to access, and yes I've restarted the server. Nginx is being started as root (not the best way but ...
3
votes
1answer
78 views

Remote control alarm

I want one of machine have a remote control alarm running that can be triggered by any remote machine. More precisely Machine A is running the service in the background Any remote machine B can send ...
2
votes
1answer
73 views

Why doesn't `netstat` show Screen client but only Screen server process?

From https://unix.stackexchange.com/a/485290/674 Further down in the netstat output is UNIX sockets: Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State ...
2
votes
1answer
308 views

ss command: difference between raw and unix sockets

The ss command (from the iproute2 set of tools which comes as a newer alternative to netstat) has in its --help the following options -0, --packet display PACKET sockets -t, --tcp ...
2
votes
1answer
322 views

tmux socket api

Is there any way I can control a tmux server and send commands to it like switching to a specific window in a session, or make some queries about the panes through the socket it creates? I've looked ...
2
votes
1answer
888 views

Is a subdirectory of /tmp a suitable place for Unix sockets?

I am looking for a secure place to put Unix domain sockets that will be used to control a REPL. On Linux, I would use /run/user/$UID, which meets all requirements except for portability. I need the ...
2
votes
1answer
106 views

Telephony API alternative for Linux?

Is there is any Telephony API for Linux like we have "Tapi.h" for Windows?
2
votes
0answers
559 views

UNIX sockets vs AF_NETLINK vs Kdbus vs Binder

What are essential differences between those IPCs? Which are main use cases? Is there some consolidated comparison table between them somewhere? Something like: Protocol: AF_UNIX | ...
1
vote
2answers
177 views

How many connections can there be between two Unix domain sockets?

From APUE: 17.3 Unique Connections A server can arrange for unique UNIX domain connections to clients using the standard bind, listen, and accept functions. Clients use connect to ...
1
vote
1answer
127 views

It is possible to traceroute without touching ICMP?

I often run into a situation where I want to traceroute an IP without root or NET_RAW cap in Linux. I have attempted to send a UDP packet with a small TTL but no ttl error is emitted at all. It seems ...
1
vote
2answers
58 views

Does OpenSSH >=7.2 support local-side tilde expansion for remote Unix socket forwarding

I am trying to forward a gpg-agent Unix socket to a remote machine. I have tried the following two versions of the remote forwarding command: A: ssh -vvv -N -R ~/.gnupg/S.gpg-agent:~/.gnupg/S.gpg-...
1
vote
1answer
215 views

Using Unix domain socket for different hosts

Actually, I have software that runs in the ARM-Linux has three apps of mine.I want to run the one certain application in Linux host x86. The internal components in my ARM-Linux program communicate ...
1
vote
1answer
561 views

Can a socket be used if its file is read-only?

Can a socket be used if its file is read-only? For example, if a program needs to be use a socket to communicate with a daemon, but it cannot be allowed to delete the socket. Because, say, it wouldn'...
1
vote
1answer
352 views

Detect unix domain socket deletion?

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket, passes data to ...
1
vote
2answers
106 views

Different order for getsockopt SO_PEERCRED in Linux and OpenBSD

I'm trying to get the Unix socket peer credentials in python. I am using this piece of code for that: peercred = conn.getsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, struct.calcsize("3i")) pid, ...
1
vote
1answer
210 views

How to configure systemd so that PHP can use memcached unix socket?

I'm in the process of upgrading from Ubuntu Server 16.04 to 18.04 and at the same time upgrading from PHP 5.6 to PHP 7. In /etc/memcached.conf I added: -s /tmp/memcached.sock -a 666 When I restart ...
1
vote
1answer
32 views

How to avoid forwarding ports?

I am doing UDP socket programming in C. In order to listen to a port, I need to forward ports in my router. My question is how to avoid doing that and still being able to communicate over the internet,...
1
vote
1answer
417 views

How to replicate data from /dev/log on to multiple rsyslog receivers

I want to run multiple instances of rsyslogd (on different network namespaces [netns]). rsyslogd reads from /dev/log, and once a process reads, the socket is drained and another instance doesn't have ...
1
vote
1answer
705 views

Unix Domain Socket with VM

Is it a true statement that, shared memory does not work between a host OS and guest OS, but a Unix Domain Socket (specifically udp) can communicate between the two? An in depth explanation would be ...
1
vote
1answer
67 views

Sending data to Unix socket failing unless proxied with socat via UDP

I'm trying to debug why data isn't being sent over a Unix Domain Socket. I have 2 applications which should be communicating over a UDS but aren't. To test I've done the following: Using socat, I ...
1
vote
2answers
296 views

Rsyslog - How to disable udp syslog?

Currently rsyslog is listening on both UDP socket and UNIX socket, as shown below: [root@machine ~]# netstat -ap | grep rsyslog udp 0 0 0.0.0.0:59018 0.0.0.0:* ...
1
vote
1answer
515 views

How to create a public unix domain socket?

Consider /var/run/acpid.socket. At any point I can connect to it and disconnect from it. Compare that with nc: $ nc -l -U ./myunixsocket.sock Ncat: bind to ./myunixsocket.sock: Address already in use....
1
vote
1answer
104 views

inflight sockets in linux

I was checking code of sendmsg system call for AF_UNIX socket, there I find one function: wait_for_unix_gc ( a garbage collector of inflight sockets). Can anyone brief what these inflight sockets are? ...
1
vote
0answers
23 views

Deleting the files from a SFTP server based modified time (SSH not enabled )

Need to delete the files from a sftp remote server based on last modified time .Files which are older then 30 days no need to keep in server .I have tried ls -lt ,but how to copy it to local machine ...
1
vote
0answers
125 views

Total socket count steadily increasing, tcp/udp sockets steady. Why?

I have a server (Ubuntu 16.04.5) running sockets.io and a few other things. This server is running about 5 or 6 different python apps and sockets.io. When the server reaches this level of ~6144 ...
1
vote
1answer
51 views

Read GNU screen session without attaching to it

I use GNU screen mostly to run commands that become non-interactive after some initial input. I do not like navigating output in screen sessions, I feel it is a bit buggy. Is there a way to access ...