Skip to main content

Questions tagged [unix-sockets]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
17 views

Unix domain socket frame structure

How does a unix domain socket packet look like? Is it like a TCP/IP packet which have an ethernet header, an IP header and a TCP header? How do they look like in unix domain socket?
William's user avatar
  • 165
2 votes
1 answer
87 views

Proxy between UNIX socket with socat

I used socal to create a proxy server between 2 UNIX sockets: /var/a.sock , /var/b.sock client -> /var/a.sock -> MY_COMMAND -> /var/b.sock -> MY_COMMAND -> /var/a.sock ->client. The ...
Polo1990's user avatar
0 votes
0 answers
27 views

Why cinnamon with wayland creates 2 unix sockets?

X11 by default will create one unix socket on /tmp/.X11-unix, which named "X" + the number of the display. But when i use cinnamon with wayland, it creates /tmp/.X11-unix/X0 AND /tmp/.X11-...
thiago1255's user avatar
0 votes
1 answer
64 views

What is a port?

I have been running an Apache web server for numerous years and have been using ports as a medium to serve requests. Recently, I began using Unix sockets to serve MySQL requests. The function of Unix ...
user10709800's user avatar
1 vote
1 answer
21 views

Unix socket in /tmp turns into directory on reboot

I run an Ubuntu based server on raspi (6.5.0-1015-raspi #18-Ubuntu). On this system, I have knxd running, exposing a KNX bus to my server, and then Home Asssitant in a docker container. knxd and ...
Martin Probst's user avatar
0 votes
1 answer
63 views

How can I find out what so_type an existing unix socket has in macOS?

In linux we can run ss -x or lsof -U +E and we can see what type unix socket has. But in macOS there is no ss or we can run lsof -U which only shows TYPE - unix, but I would like to know with some ...
amkgi's user avatar
  • 103
1 vote
0 answers
56 views

pcscd unix domain socket forwarding

I want to forward smart card request to a pc where smart card is connected but am unable to forward socket via ssh source : 10.169.213.211(server) destination : 10.169.41.124(client) what I attempt to ...
Itsme's user avatar
  • 11
0 votes
1 answer
112 views

Delete only processed files from SFTP

We have 1000 files in SFTP server and are able to process in local server using linux script and it takes 10 mins, after processing we wants delete only processed files. Mean time we my get some new ...
venkata krishna's user avatar
0 votes
0 answers
155 views

Is it possible to make Linux use Unix Domain Socket automatically on local socket

My team is developing a micro-service web backend. The developers know nothing about deployment, they just deploy the service with some web framework, such as Springboot. The deployment is controlled ...
Yves's user avatar
  • 3,331
1 vote
0 answers
784 views

prometheus node exporter sockstat

I'm looking for the meaning of the node_sockstat_TCP_mem_* metrics. The output of the node exporter describes them as follows: # HELP node_sockstat_TCP_mem Number of TCP sockets in state mem. # TYPE ...
Emmanuel's user avatar
  • 4,197
1 vote
1 answer
212 views

ss doesn't display socket info related to the process opening SOL_SOCKET

I run a python code inside docker container performing the following calls import socket as s,subprocess as sp;s1=s.socket(s.AF_INET,s.SOCK_STREAM); s1.setsockopt(s.SOL_SOCKET,s.SO_REUSEADDR, 1);s1....
DmitrySemenov's user avatar
1 vote
0 answers
230 views

nginx and workers and linux tcp sockets/lsof

I started nginx with just a single worker. ps --forest -fC nginx UID PID PPID C STIME TTY TIME CMD root 3615889 10118 0 14:18 ? 00:00:00 nginx: master ...
DmitrySemenov's user avatar
0 votes
0 answers
27 views

Linux mkfifo not writable by other users [duplicate]

I have a program that creates a socket and waits that someone writes on it, I would like to write with another users but even after changing permissions i cant. mkfifo -m 777 /tmp/socket running the ...
Sonic803's user avatar
0 votes
1 answer
562 views

Writing to unix socket file as fast as possible

I'm trying to write with perl to a unix socket file as fast as possible but failing on full message buffer. I tried autoflush and manual flush without success. use IO::Select; use IO::Socket::UNIX; ...
user496909's user avatar
0 votes
1 answer
311 views

how to remove file 0= file which has srw permission

How can I remove below file? srwxrwxrwx 1 patroh root 0 Aug 8 16:11 0= The user patroh is myself. The rm command won't work - it doesn't give any error when I execute rm 0. I am not sure ...
Rocky's user avatar
  • 3
0 votes
0 answers
470 views

Socat serial to tcp for authorized users

Hello everyone I hope you doing well I have a raspberry pi and I kind need a serial port server which can access from internet Now I use socat command like bellow on my raspberry and from putty on ...
Hamidreza's user avatar
0 votes
1 answer
64 views

EPROTOTYPE (_SIGN 41 ) while creating raw socket() in MINIX 3

The following is my code snippet that is producing EPROTOTYPE error, aka, Protocol Wrong Type for Socket. I checked for the headers in /usr/include in MINIX 3, sys/socket.h contains definitions for ...
Reiki Yamya's user avatar
2 votes
1 answer
1k views

Can a single unix domain socket connect to multiple peers simultaneously?

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 &...
QnA's user avatar
  • 575
0 votes
0 answers
672 views

get data from socket on port

I have a specific service that sends data on port 5555. I need to open socket on shell unix to listen on this port and print output on shell. Service is deployed as docker container. So, I run ...
init's user avatar
  • 31
1 vote
1 answer
633 views

Is 2 pipes more expensive than 1 socketpair?

Suppose I want to launch a co-process and attach its standard input and output to the main process, what we have here are 2 options: call pipe(2) and create 2 pipes, and attach them separately to the ...
DannyNiu's user avatar
  • 620
3 votes
1 answer
168 views

Detect presence of non-connected socket that holds the port (on Linux)

Test on Linux (particularly: Ubuntu 20.04 LTS, kernel 5.4.0): in Python: from socket import * s1 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) s1.bind(('', 11001)) s2 = socket(AF_INET, SOCK_STREAM, ...
Netch's user avatar
  • 2,549
0 votes
1 answer
2k views

Unix-domain Socket

I'm trying to set my server up and came across some troubles related to Unix domain sockets. I don't have so much experience with Unix, despite the stack for web development: Apache, PHP and SQL. I ...
zanoth's user avatar
  • 1
4 votes
1 answer
1k views

What does SCM mean in unix sockets context (SCM_RIGHTS etc.)?

From man 7 unix SCM_RIGHTS Send or receive a set of open file descriptors from another process. The data portion contains an integer array of the file descriptors. The passed file descriptors ...
ledonter's user avatar
  • 173
0 votes
0 answers
2k views

How to create a .sock file for unix_stream

I am new to this socket programming in linux I want to send a log file i.e eve.json This file is provided by suricata and they have already defined some setting in their configuration yaml to send ...
Tech Noob's user avatar
0 votes
1 answer
353 views

Do unix domain sockets support reuse?

Do unix domain sockets support reuse? Lots of conflicting information about this online. I suspect a lot of it is just outdated, but I'm no expert. Do I ProxySet enablereuse=on if my handler is a ...
Jeff's user avatar
  • 796
5 votes
1 answer
5k views

Interacting with Unix Socket found in lsof

I found a Unix socket being used in the output of the lsof command: COMMAND PID TID TASKCMD USER FD TYPE DEVICE SIZE/OFF NODE NAME screen 110970 ...
dcom-launch's user avatar
0 votes
0 answers
560 views

How can I guess server socket type

I try to connect to my UNIX-socket server using openbsd-netcat, but have an error: connect(): Protocol wrong type for socket My socket type is SOCK_SEQPACKET, and it seems that nc tries to open it as ...
Eddy_Em's user avatar
  • 1,333
4 votes
1 answer
562 views

Why does socat fail at proxying X11 where ssh succeeds?

I am investigating how to write a simple X11 unix-socket-based proxy. I have tried various standard applications, as well as written my own code, but I am getting wildly variable results. What's ...
Tom Ellis's user avatar
  • 263
0 votes
1 answer
3k views

How can I target an X window to a secondary monitor? (and know what it is called in order to do that)

I have two monitors connected (one HDMI, one DVI) connected to an Nvidia GT710 GPU on my linux box. When I am logged in to my box over ssh, if I run xeyes it will always run on the same screen. I ...
Stonecraft's user avatar
2 votes
1 answer
6k views

unix domain socket permissions and umask integration between root and non root users

I'm trying to understand the permissions of a unix domain socket, when using an existing file, umask changes are required as well as the dir permissions. If I create a world readable dir as root and ...
nd6654ssd's user avatar
1 vote
0 answers
736 views

How to listen the requests sent to a unix socket

I'm learning docker and wanted to see the API commands sent by the client to the docker server/engine. I know that the communication between the two processes happens via /var/run/docker.sock. Is ...
sudeepdino008's user avatar
0 votes
1 answer
301 views

"Holding" a socket open too long causes a new one to spawn

I am connecting to a socket via nc -U: user@node:~$ sudo nc -U service\@name.18822.sock user@node:~$ xmpp.status user@node:~$ connected If I "hold" this connection open too long, it will ...
Kahn's user avatar
  • 1,732
0 votes
0 answers
890 views

Problem Accessing UNIX sockets remotely via SSH tunnel

I'm trying to use a TCP port to connect to a MySQL unix domain socket on a remote machine. I have removed networking on the mySQL server to harden it. The SSH tunnel looks like this: MyPC <---------...
Andy's user avatar
  • 1
3 votes
1 answer
945 views

Possible scenarios for Unix domain sockets interruption

When using TCP & UDP sockets, there are many scenarios which cause connection interruption (slow connection, network reset, etc). Is there any possible situation which an unix domain socket ...
AmirHmZ's user avatar
  • 83
7 votes
2 answers
3k views

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/...
oarfish's user avatar
  • 414
1 vote
0 answers
612 views

socat bidrectionally with a shell script. echo, read, then hand off to socat

There is a VMM which doesn't conform to the the standard VSOCK implementation: Firecracker For each guest it creates a v.sock unix socket file The ordinary VSOCK-CONNECT:cid:1234 then becomes: UNIX-...
Jack Fleming's user avatar
5 votes
0 answers
892 views

AF_UNIX: Using recv() to receive a message sent with sendmsg()

The function prototype for the sendmsg() function is as follows: ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); and the msghdr struct is such: struct msghdr { void *...
novice's user avatar
  • 429
0 votes
1 answer
183 views

Why systemd says its dependency system should be used only sparingly?

From systemd.unit(5) man page: Note that while systemd offers a flexible dependency system between units it is recommended to use this functionality only sparingly and instead rely on techniques such ...
Small Boy's user avatar
4 votes
1 answer
3k views

hostnamectl command causes Failed to create bus connection: No such file or directory

I'm following this guide and I'm running into issues. https://www.tecmint.com/initial-ubuntu-server-setup-guide/ I am trying to create a linux machine in Ubuntu in wsl2 and then rename it using ...
Ambitious Intern's user avatar
0 votes
1 answer
1k views

How to use unix domain socket for tor socks

I am trying to setup a unix socks socket for tor usage instead of port 9050 in the hopes to gain a tiny bit of performance. However I am getting the below error: Oct 21 11:53:54 HOSTNAME Tor[992986]: ...
balki's user avatar
  • 4,447
4 votes
1 answer
3k views

What happens when two processes listen on the same Berkeley/Unix [file] socket?

What happens when I set up two processes to listen to the same Berkeley socket? Do messages get routed to both? Neither? One of the two? If so, how? Concretely, I can start two gunicorn processes with ...
ijoseph's user avatar
  • 164
5 votes
1 answer
3k views

/proc/[pid]/fd/[0, 1, 2]: No such file or device - even though file exists

I'm trying to access a process' stdio streams from outside its parent process. I've found the /proc/[pid]/fd directory, but when I try $ cat /proc/[pid]/fd/1 I get a No such file or device error. I ...
J-Cake's user avatar
  • 229
2 votes
0 answers
644 views

Can systemd be used as an inetd/xinetd replacement without being an init?

Can systemd be configured (in runtime or compile time) to serve as a simple process supervisor, not as /sbin/init? If yes, are there tutorials and other documentation to follow to make customized non-...
Vi.'s user avatar
  • 5,813
3 votes
2 answers
3k views

Does every socket have its own buffers to send/receive messages?

I'm developping a C application that make extensive use of sockets. My doubt is: Does every socket that I create have its own buffers to send and/or receive messages from other sockets? In other words,...
j0s3's user avatar
  • 31
0 votes
1 answer
690 views

what will happen if receiver unable to handle data velocity through socket?

I have two processes P1 (sender) and P2 (receiver). P1 uses unix-domain-socket (UDS) to send data to P2. what will happen if P1 sends data at the rate of 100 messages/second and P2 is capable to ...
Karthik Nedunchezhiyan's user avatar
4 votes
1 answer
5k views

Is there a command to list all abstract unix sockets currently open?

Is there a command or system call for listing all the abstract unix sockets currently open? Update: It was suggested that I use netstat -x, which theoretically works, but does not list the names of ...
merlin2011's user avatar
  • 3,975
0 votes
1 answer
246 views

Are socketpairs useable as signal-safe buffers?

I am thinking on a way of communication between signal handlers and the main program. Note, I use mosly non-blocking signals (a new signal can arrive even while a signal handler is executed), so I am ...
peterh's user avatar
  • 9,828
1 vote
1 answer
537 views

Stop child services when systemd socket connection closes

I'm trying to launch a meta-service remotely through a socket. Requirements: The socket should start the meta-service when a connection is established The meta-service should start all child (Wants=)...
Stewart's user avatar
  • 14.2k
1 vote
1 answer
3k views

How to get notified when the other end of a socketpair is closed?

I have a parent process (client) talking with a child process (server) over Unix Domain sockets (aka IPC Sockets). The sockets are created using socketpair() and are of type datagram. I use ...
Droopycom's user avatar
  • 131
7 votes
2 answers
6k views

Unix domain sockets for non-root user

I work on the application that uses Unix domain socket for IPC. The common way as I know is to place the socket file inside /var/run. I work with Ubuntu 18.04 and I see that var/run is a symlink for /...
folibis's user avatar
  • 379