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.

1
vote
1answer
42 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 ...
4
votes
2answers
133 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 ...
0
votes
2answers
45 views

Can one processes have a descriptor that is non-blocking while another process have a descriptor referencing the same file/socket that is blocking?

I am more interested in sockets than regular files, but basically I want to know whether one process can "see" a socket as blocking where another process can see it as non-blocking. I am guessing yes,...
1
vote
2answers
143 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 ...
0
votes
2answers
75 views

Must an application-layer protocol exist for communication between any two programs using sockets?

When any two programs, no matter how simple or complicated, communicate by internet domain sockets (or Unix domain sockets), does it necessarily imply that there is an application-layer protocol ...
0
votes
0answers
270 views

socat - UNIX-LISTEN and TCP-LISTEN in one command

Is it possible, to open a tcp port and a socket with one process/command? socat UNIX-LISTEN:/var/run/mysqld/mysqld.sock,fork,user=mysql,group=mysql,mode=777 TCP:123.123.123.1:3306 combined with: ...
4
votes
1answer
174 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'...
1
vote
1answer
245 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
1answer
92 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
92 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, ...
0
votes
0answers
54 views

Listen to specific event types via process netlink connector

I'm authoring a user app that would listen to process events via the process netlink connector. While listening on the socket, my process spends a lot of time doing busy work because of lots of ...
3
votes
1answer
70 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 ...
0
votes
1answer
114 views

syslog-ng modification issue for unix socket

I am having issue researching the right way to go about a problem. The problem is the syslog-ng file in the salt master server at the moment only enforces unix-stream as follows: source s_sys { ...
4
votes
1answer
136 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 ...
1
vote
1answer
197 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
2answers
253 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
0answers
112 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
28 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
449 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....
2
votes
1answer
286 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 ...
1
vote
1answer
49 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 ...
1
vote
2answers
56 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-...
0
votes
1answer
507 views

ssh: channel xx: open failed: connect failed: open failed

I'm running ssh running on macOS to redirect connections to local Unix domain socket to a domain socket on another machine. The command line for ssh call is roughly the following: $ ssh -nNT -L /var/...
5
votes
1answer
289 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 ...
8
votes
1answer
1k 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
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> ...
2
votes
1answer
303 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 ...
1
vote
0answers
158 views

Is there any rsync option to avoid errors on sockets in the source

I'm trying to back up a user's files on a remote machine, but I can't find any rsync option to avoid errors ... ++ rsync -a --no-D --delete --stats '--exclude=.cache/*' --password-file=a_secret ...
1
vote
0answers
61 views

“Multiplex uid mismatch” when trying to get info from Unix socket

I created a unix socket in order to enable SSH multiplexing for my SSH tunnel. I'm new to unix sockets so I wanted to see what this pseudo-file in my filesystem contains. I've tried using: nc -U ...
0
votes
0answers
96 views

Shared buffer for user space processes

Currently Im implementing a shared buffer between user space processes. For that, I have a library which opens a client UNIX socket for the client processes to dump events into the server socket. My ...
1
vote
0answers
107 views

same netlink socket for inter-user space process communication and user space-kernel space communication?

Is it possible to use the same netlink socket for kernel - user space process and witin user space process communication??
1
vote
0answers
525 views

Communication between user space and kernel space - AF_netlink + AF_Unix

I am new to IPC and am trying to implement a common buffer between kernel and user space processes. My design will be in such a way, I will have a library(in user space) where my client socket tries ...
3
votes
1answer
3k 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 ...
1
vote
1answer
204 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 ...
3
votes
1answer
619 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, ...
0
votes
1answer
570 views

sudo netstat -antp not showing PID

i am testing stuff with sockets and i encountered that strange case : i coded i very simple tcp server in c, i made it block after accept(), just to see what happen when accepting multiple connection ...
0
votes
0answers
350 views

/var/log mounted as a tmpfs failing to get umounted on FreeBSD

I have /var/log mounted as a tmpfs, where log files are synced periodically to the disk by the cron on FreeBSD. The process is done by the rc script. I am mounting it like: mount -t tmpfs -o nosuid,...
3
votes
1answer
429 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 ...
0
votes
1answer
2k views

Proxying traffic on local unix to a remote unix socket over SSH

I am trying to have a local Unix domain socket, say, ~/docker.sock. I want it to proxy everything to a remote Unix domain socket running elsewhere over SSH. (You can find a diagram of what I’m trying ...
0
votes
0answers
24 views

Opening daemon specific ports

How can we set firewall inbound rules for specific daemon if it is using random port from range of Ephemeral ports? There is Custom Rule wizard available in Windows. Does LINUX and UNIX has similar ...
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 ...
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 ...
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 ...
3
votes
1answer
433 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 ...
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 ...
2
votes
1answer
105 views

Telephony API alternative for Linux?

Is there is any Telephony API for Linux like we have "Tapi.h" for Windows?
1
vote
1answer
1k views

Find out details of a socket by the socket's path name?

I ran an strace on a client application failure and got something like this: socket(PF_LOCAL, SOCK_SEQPACKET|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 setsockopt(3, SOL_SOCKET, SO_PASSCRED, [1], 4) = 0 ...
0
votes
1answer
420 views

Can I view file names from zipped tar file without unzip and extracting it?

Can I view file names from zipped tar file without unzip and extracting it? The command tar -tvf will show the file contents with out extracting it. Is it possible with zipped tar file?
1
vote
1answer
411 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 ...
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 ...