Questions tagged [unix-sockets]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
2k 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 ...
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 ...
1
vote
0answers
27 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 ...
0
votes
1answer
36 views

How can a client talk to another client using unix domain sockets?

Using bash we might have something like this with netcat: nc -lk -U /my/fifo | while read line; do # line => {"client_id":123} done; clients send data like this: echo '{"client_id":123,"data":...
6
votes
3answers
856 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 ...
17
votes
1answer
788 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 ...
1
vote
1answer
107 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
210 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
49 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
216 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
80 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
393 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: ...
0
votes
1answer
428 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 ...
4
votes
1answer
264 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
153 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
110 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
76 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
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
4k 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 ...
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 ...
0
votes
1answer
137 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 { ...
1
vote
1answer
228 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 ...
4
votes
1answer
177 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
2answers
340 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
133 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 ...
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? (...
1
vote
1answer
36 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
609 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
339 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
53 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
59 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
703 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
321 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 ...
9
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
3
votes
1answer
483 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 ...
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
345 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
170 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
64 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
100 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
120 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
560 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
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 ...
1
vote
1answer
241 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
687 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
632 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
369 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,...
0
votes
1answer
3k 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 ...
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 ...