Questions tagged [unix-sockets]
The unix-sockets tag has no usage guidance.
125
questions
-1
votes
0
answers
30
views
Which process communicate with Unix socket
I see process that has unix socket
PID=55
netstat -nxpl | grep 55
I see Proto=unix , State=LISTENING, Inode=1234 pid=55
I can see that Inode in /proc/net/unix
How can I know which process communicate ...
0
votes
1
answer
25
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 ...
0
votes
0
answers
70
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 ...
0
votes
0
answers
224
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 ...
1
vote
1
answer
58
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....
1
vote
0
answers
125
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 ...
0
votes
0
answers
96
views
Using chrony with non-root sockets
I'm trying to used chrony in conjunction with a C++ application I'm working on.
Ideally I would like to send information to chrony using sockets rather than SHM, but it seems that chrony can only ...
0
votes
0
answers
26
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 ...
0
votes
0
answers
63
views
Auditd - SOCKADDR - AF_LOCAL - Parsing issues
(Cross posted)
I set out to parse an auditd log entry containing a SOCKADDR event. I am running into issues with additional data and trying to identify where its coming from and the structure of it.
...
0
votes
1
answer
415
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;
...
0
votes
1
answer
196
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 ...
0
votes
0
answers
380
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 ...
0
votes
1
answer
50
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 ...
2
votes
1
answer
786
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 &...
0
votes
0
answers
441
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 ...
1
vote
1
answer
399
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 ...
3
votes
1
answer
112
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, ...
0
votes
1
answer
881
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 ...
4
votes
1
answer
667
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 ...
0
votes
0
answers
827
views
How to allow the docker container to reach host's X11 socket without --net=host?
The old trick, using '-v /tmp/.X11-unix:/tmp/.X11-unix' to allow to use the host container no longer works.
I could make it work using '--net=host', but that makes the guest use the whole net ...
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 ...
0
votes
1
answer
257
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 ...
4
votes
1
answer
3k
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 ...
0
votes
0
answers
371
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 ...
3
votes
1
answer
344
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 ...
0
votes
1
answer
2k
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 ...
1
vote
1
answer
4k
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 ...
1
vote
0
answers
443
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 ...
0
votes
1
answer
265
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 ...
0
votes
0
answers
731
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 <---------...
3
votes
1
answer
752
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 ...
7
votes
2
answers
2k
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/...
1
vote
0
answers
502
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-...
5
votes
0
answers
646
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 *...
0
votes
1
answer
147
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 ...
4
votes
1
answer
2k
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 ...
0
votes
1
answer
978
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]: ...
4
votes
1
answer
2k
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 ...
4
votes
1
answer
2k
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 ...
1
vote
0
answers
498
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-...
3
votes
2
answers
2k
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,...
0
votes
1
answer
533
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 ...
3
votes
1
answer
3k
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 ...
0
votes
1
answer
210
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 ...
1
vote
1
answer
453
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=)...
1
vote
1
answer
2k
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 ...
7
votes
2
answers
4k
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 /...
8
votes
1
answer
3k
views
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:<port>?
something like:
file:///tmp/webpage.sock
my only real ...
0
votes
1
answer
934
views
cannot find screen session I detached from
I am running a program on Unix server and I am mindful that I detached the screen and logged out of the server. Later I ssh'd back in and tried to reattach but I just cannot find my screen.
In fact ...
0
votes
0
answers
223
views
Connect docker-container with other container by unit-socket
I'am trying to connect to containers by unit-socket/
docker run -d -v /var/lib/docker/overlay/[container_id]/var/run/postgresql/.s.PGSQL.5432:/socket_volume/.s.PGSQL.5432 -p 50000:8080 my_repo/...