Questions tagged [ipc]

Inter Process Communication usually refers to kernel services that allow processes on the same machine to communicate with each other.

Filter by
Sorted by
Tagged with
1 vote
1 answer
25 views

How to list all object paths under a dbus service only usign dbus command-line utility?

How can I list the object path under a dbus services using ONLY dbus-send command line utility? For now, I can only list services: dbus-send --system --dest=org.freedesktop.DBus --type=method_call --...
user avatar
  • 11
1 vote
1 answer
37 views

bash IPC using named pipes

Consider the below script #!/usr/bin/bash chan=/tmp/pipe.$$ mkfifo $chan { for x in a b c d e do echo $x > $chan done } & for y in 1 2 3 4 5 do x=$(cat $chan) echo &...
user avatar
  • 4,039
1 vote
0 answers
23 views

File locking from different therads of the same process, including for Solaris OS

I need to perform a file lock when accessing a file from C/C++ code with the following requirements: Blocking should be performed when access occurs not only from different processes, but also from ...
user avatar
  • 205
0 votes
0 answers
51 views

ipcrm won't delete some shared memory blocks

I have shared memory I am trying to delete using ipcrm on a Mac. I managed to delete all segments except the below: T ID KEY MODE OWNER GROUP Shared Memory: m 2359296 ...
user avatar
0 votes
0 answers
58 views

Are there any plans for Linux to add higher-level things like Windows' WaitForMultipleObjects?

WaitForMultipleObjects is one of several Windows kernel functions that can suspend and synchronize a calling thread with other threads until resources or etc are available, similar to flock in Linux, ...
user avatar
0 votes
0 answers
49 views

When to use named FIFO over posix message queues for IPC and process-thread communication

Trying to understand which IPC mechanism (mqueue vs mkfifo) is preferred to use in which scenario. I have got two different processes/tasks and multiple threads running in one of the processes. The ...
user avatar
  • 21
0 votes
1 answer
40 views

How to redirect running process output from pipe to something else?

Is there any way to redirect stdout (1) from that "pipe" (I don't know exacly how I suppose interpret this, I will be glad if someone could explain how to treat this, or give me some read on ...
user avatar
  • 103
1 vote
0 answers
76 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 ...
user avatar
0 votes
0 answers
77 views

Internals of signal handling

I have been studying this excellent Caltech lecture regarding the signal delivery mechanism, which talks about how current process state (stack, RIP etc) at the time of the signal generation is copied,...
user avatar
  • 153
0 votes
1 answer
526 views

How to open an existing named semaphore?

Obviously O_CREAT and O_EXCL are not required when opening an existing semaphore. O_CREAT is required when creating a new semaphore. O_EXCL is only meaningful when OR-ing with O_CREAT, specifying that ...
user avatar
  • 121
0 votes
1 answer
126 views

List processes associated with shared memory

When I run ipcs -m I get below info ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000 38699014 user 700 8125440 2 dest 0x00072 2064391 ...
user avatar
1 vote
1 answer
74 views

How can we trace a TCP/IP packet in a server

I'm developing a backend service. The backend contains some processes, meaning that when a client sends a request to my server, the request will go through these processes. For example, a request will ...
user avatar
  • 2,809
0 votes
0 answers
126 views

Is there dependency between Unix/Linux IPC facilities?

The Linux Programming Interface summarizes UNIX/Linux IPC facilities for communication and synchronization Is there dependency between any of the facilities? Either between their interfaces or their (...
user avatar
  • 89.8k
0 votes
1 answer
358 views

systemd service permission error when binding to ipc port inside a VM

I'm using vagrant to emulate services with network communication. My base box is the ubuntu/bionic64. The application that I'm porting to the VM is written in C++ and binds to ipc addresses as follows:...
user avatar
  • 103
1 vote
1 answer
58 views

Is RAM usage of IPC a part of the RAM usage of a program

I'm learning how to use Message Queue in Linux and I've found a simple example: https://www.geeksforgeeks.org/ipc-using-message-queues/. With the reader and writer in this link, I can read and write ...
user avatar
  • 2,809
-2 votes
1 answer
373 views

Does execve() make a child unrelated to its parent?

When a process fork() a child, the two processes are related. The child inherits a lot of things from the parent, including some IPC objects such as pipes and anonymous memory mappings. If the child ...
user avatar
  • 89.8k
0 votes
1 answer
517 views

Do anonymous memory mapping and shared memory allocate space from physical memory only?

In Linux, when using mmap() for anonymous memory mapping, or using malloc(), do they allocate "space" from only physical memory, or either physical memory or swap or their combination? (I ...
user avatar
  • 89.8k
0 votes
1 answer
23 views

How can I separate an already-running process from its parent?

There are three processes: A "control program", call it CP. CP launches a manager process, call it MP. MP launches a worker process, call it WP. CP is the only program I can modify. All ...
user avatar
  • 761
0 votes
2 answers
53 views

Get output and input into daemon processes

Background When a SIGHUP is sent to a running nginx master process to reconfigure, if there're password encrypted certificate key, nginx(specifically the openssl library) will ask for input, as in the ...
user avatar
4 votes
1 answer
912 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 ...
user avatar
  • 143
0 votes
1 answer
269 views

Programming - Communicating with chess engine stockfish / FIFOs / Bash redirections

I'm trying to write a little chess program - actually more of a chess GUI. The chess GUI should use the stockfish chess engine in the background when the player plays against the computer. I got ...
user avatar
  • 3
0 votes
1 answer
92 views

How to guarantee that that only a specific process reads from a named pipe?

Suppose that, at time (1), I create a named pipe using Python with the goal that eventually this Python process would write something to that named pipe. Why? Because, at time (2), there is another ...
user avatar
  • 143
1 vote
1 answer
1k 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 ...
user avatar
  • 131
3 votes
1 answer
731 views

Binding a AF_UNIX to any existing file?

Can we bind a Unix domain socket to any random existing file ? If no, how do you recognize a file that is used by a socket ?
user avatar
1 vote
1 answer
549 views

Why below code is not able to unblock SIGINT signal

I am trying my hand on Linux Signals. Where I have created a scenario mentioned below: Initially block all SIGINT signals using sigprocmask(). If sender send SIGUSR1 signal then unblock SIGINT for ...
user avatar
  • 67
3 votes
1 answer
78 views

Obtaining and returning a permit from a semaphore in a shell script

In a shell script I can use: ipcmk -S 4 To create a semaphore with 4 slots. With ipcrm I could delete the semaphore again. But how can I use it? I cannot find any semwait, ipcsemget or similar. How ...
user avatar
  • 754
2 votes
1 answer
2k views

How do the kernel and processes communicate?

In Linux there are various ways for inter process communication, for example, shared memory, (named) pipe, socket, message queue. What are equivalent or similar ways in which Linux kernel and ...
user avatar
  • 89.8k
2 votes
1 answer
576 views

Optimal sharing of a ring buffer between processes

We're implementing an embedded Linux system and have to provide a live updating graph on a website that shows data coming from a background process in the system. The question is how to optimally ...
user avatar
  • 31
4 votes
2 answers
2k views

How does journald know the PID of a process that produces log data?

When I look at journalctl, it tells me the PID and the program name(or service name?) of a log entry. Then I wondered, logs are created by other processes, how do systemd-journald know the PID of ...
user avatar
0 votes
1 answer
900 views

Why when I run `$ ipcs` are all shared memory segment keys "0x00000000"?

So when I run $ ipcs, the shared memory segment section returns a variety of results: ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status ...
user avatar
0 votes
1 answer
2k views

bash: Reading a full record from a fifo

I wish to send a command to process A, from process B, via a FIFO. The command will be a word or a sentence, but wholly contained on a "\n" terminated line - but could, in general, be a multi-line ...
user avatar
  • 722
2 votes
1 answer
100 views

Does pseudoterminal transfer byte stream or message?

From The Linux Programming Interface under "data transfer" under "communication", we have "byte stream", "message" and "pseudoterminal". Does pseudoterminal belong to byte stream instead, just like ...
user avatar
  • 89.8k
1 vote
1 answer
142 views

Can FIFO or other thing not block on writer's access, and instead just drop data?

FIFO is problematic in use because both reader and writer have to open it – if one of them is being late, the other one is blocked inside the operating system. I have to implement a publishing ...
user avatar
  • 13
1 vote
1 answer
1k views

netlink: GNEL_ID_GENERATE definition removed from RHEL7.5 kernel library

We have a kernel module that was building fine for RedHat family of Linux distribution, until the recent RHEL7.5. When trying to build on RHEL7.5, we've got an error of: ...error: ‘GENL_ID_GENERATE’...
user avatar
2 votes
1 answer
6k views

What is the purpose of using a FIFO vs a temporary file or a pipe?

From APUE FIFOs can be used to duplicate an output stream in a series of shell commands. This prevents writing the data to an intermediate disk file (similar to using pipes to avoid intermediate ...
user avatar
  • 89.8k
4 votes
1 answer
7k views

Sharing file descriptors

If file descriptors are specific to each process (i.e. two processes may use the same file descriptor id to refer to different open files) then how is it possible to share transfer file descriptors (e....
user avatar
  • 153
0 votes
0 answers
123 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 ...
user avatar
1 vote
0 answers
174 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??
user avatar
1 vote
0 answers
1k 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 ...
user avatar
0 votes
1 answer
51 views

What methods exist for capturing stdout into a buffer that is automatically cleared on read?

I want to store the stdout from a process into a buffer and have the buffer emptied once read, FIFO style. I know that I can pipe the stdout, but the pipe/file will keep growing and contain data that ...
user avatar
0 votes
1 answer
131 views

Question about IPC [closed]

Hello and thanks in advance for any help anyone can offer to help me understand this I'm curious about a 30.000 ft view on how IPC works in Linux between parent-child processes...I understand there's ...
user avatar
  • 121
1 vote
0 answers
267 views

How to measure the bandwidth of IPC

I need to do some measure about communication between two processes in my Ubuntu server. Saying that the two processes are process A and process B. A keeps sending data to B. I need to get two kinds ...
user avatar
  • 2,809
0 votes
1 answer
578 views

Issues due to independent concurrent writes to shared memory

Actually I would like to know the issues caused by independent concurrent writes to shared memory. To be more elobarote, consider we have three processes (proc1, proc2, proc3). These 3 processes are ...
user avatar
0 votes
1 answer
1k views

Handling multiple messages in message queue

I've done some research about this topic but I didn't understand it quite well. From msgsnd man page : The msgsnd() system call appends a copy of the message pointed to by msgp to the ...
user avatar
0 votes
1 answer
507 views

Handling SIGALRM in two different ways

How can we handle 2 different alarms sent by alarm()?? For example if I have A=5 and B=10, how can I say to my program to do an action after A seconds and a different one after B seconds without ...
user avatar
5 votes
1 answer
1k views

Command line pub / sub without a server?

Is there a way of implementing the publish / subscribe pattern from the command line without using a server process? This need only work on one machine. The main thing I want to avoid by not having a ...
user avatar
  • 1,046
2 votes
0 answers
564 views

trapping signals without interfering with other signals

When trapping a signal in a shell script, the trap commands are not executed until the current command finishes. For example, consider the following shell script: #!/bin/bash trap 'echo "SIGTERM ...
user avatar
  • 3,530
-2 votes
2 answers
966 views

Systemd service not running with read FIFO [closed]

I wrote a script that listens for commands from a FIFO and collects couple of files for debugging on my raspberry pi, all working fine until i decided to write a systemd unit file for it. running ...
user avatar
  • 113
-3 votes
2 answers
387 views

inter process comunication in bash read commands in multiple background functions

I'm trying to get the following code to read from a main input then read that in one function then be able to send that into the input of another function but i am having trouble getting it to work ...
user avatar
1 vote
0 answers
67 views

What is the difference between message key and message descriptor in message passing in System V IPC?

Why is there a separate requirement of key and descriptors in message queues? Why only key is not sufficient to describe a queue? According to me, both are unique for a message queue, and hence ...
user avatar
  • 111