A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
1answer
47 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 ?
0
votes
0answers
12 views

Can a process directly wake up and deliver message to other process?

Can a process directly bring back other process's context to CPU and deliver message to that process, with things like interrupt? If the process, that I want to wake up and deliver message to, is ...
1
vote
1answer
115 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 ...
2
votes
0answers
27 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 ...
0
votes
0answers
46 views

How does bash implement the “|” operator? [duplicate]

I have a question regarding the pipe operator ("|"). How does bash connect the output of one command or process to the input of another? Is it using the pipe system call or some other way? A sample ...
2
votes
1answer
425 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 ...
2
votes
0answers
87 views

Legitimate reasons for a program to intercept, internally handle and ignore SIGINT signal

We know that - aside from SIGKILL and SIGSTOP - a program can intercept IPC signals, and run its internal handler circumventing the operation of the default handler. I can think of at least one very ...
1
vote
1answer
256 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 ...
2
votes
2answers
482 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 ...
-1
votes
1answer
410 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 ...
0
votes
1answer
864 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 ...
2
votes
1answer
54 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 ...
1
vote
1answer
72 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 ...
1
vote
1answer
716 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’...
1
vote
1answer
2k 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 ...
2
votes
1answer
3k 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....
0
votes
0answers
107 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
147 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
718 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 ...
0
votes
1answer
41 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 ...
0
votes
1answer
101 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 ...
1
vote
0answers
187 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 ...
0
votes
1answer
305 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 ...
0
votes
1answer
737 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 ...
0
votes
1answer
259 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 ...
4
votes
1answer
981 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 ...
2
votes
0answers
406 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 ...
-2
votes
2answers
467 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 ...
-3
votes
2answers
235 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 ...
1
vote
0answers
49 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 ...
0
votes
1answer
2k views

What do asynchronous and synchronous mean in notifying processes of system events, and in process reacting to a signal delivery?

In Understanding The Linux Kernel: Unix signals provide a mechanism for notifying processes of system events. Each event has its own signal number, which is usually referred to by a symbolic ...
-2
votes
1answer
115 views

How are the processes involved when we send a signal using control keys or running `kill`? [closed]

A signal is sent by or from a process to another process. A bash process is usually run in a terminal emulator process such as gnome terminal. A bash process in turn runs other processes. So when ...
1
vote
1answer
77 views

How to verify whether two local processes are communicating via sockets or ipcs?

I have two processes given by their pids: P1 and P2. Is there are a simple way of chcecking whether these processes are communicating via sockets or other inter-process communication mechanism? I need ...
3
votes
1answer
446 views

Many-to-one two-way communication of separate programs

I have 3 different programs that I would like to intercommunicate with each other. I have an engine that needs to communicate with 2 bots and the bots with the engine. The engine is written in C++ ...
1
vote
0answers
217 views

Is using POSIX pipes/sockets for IPC memory-safe?

As far as I can tell, IPC through shared memory is fastest, but the drawback is that when one process introduces memory corruption (stack/heap corruption due to programming errors) then all bets are ...
1
vote
0answers
154 views

How to fetch semaphores and sharedmem objects for a specific apache instance when more than one apache instances run with the same app id on the box

Not sure if the question is pertinent for this forum. We have a server with 3 apache instances running with the "same" app/functional ID These instances communicate with their corresponding ...
2
votes
2answers
4k views

dbus-launch and dbus-daemon - what's happening

I grepped the ps output for dbus with the following output: 102 742 0.0 0.0 4044 1480 ? Ss Apr16 27:13 dbus-daemon --system --fork --activation=upstart xralf 2551 0.0 0.0 ...
1
vote
0answers
30 views

system service to user service information flow

I'm trying to abstract away some /dev/input files so that user-level systems can know when the touchscreen is being used vs. when the touchpad is being used (without having access to raw mouse data). ...
0
votes
1answer
58 views

How do I turn my simple script into a non polling version

I wrote a simple bash script that reads out meta information about currently playing songs via playerctl. Right now the script is just unnecessary polling the information. I would like the script to ...
1
vote
1answer
700 views

Across systems, How a process communicate with other process?

I have learnt below IPC mechanisms, BSD style half-duplex pipes SYSV style message queues SYSV style semaphore sets SYSV style shared memory segments BSD style sockets Half-duplex pipe can be used ...
-1
votes
2answers
97 views

How to control multiple processes based on user defined conditions continuously

My question involves two programs (kodi and xscreensaver). Since I have encountered this with other applications, let me be more general and say I have two applications, say App1 and App2. I wish ...
3
votes
1answer
2k views

Shell: mutual piping of STDIN/STDOUT of two commands [duplicate]

When we run this with a POSIX shell, $ cmd0 | cmd1 STDOUT of cmd0 is piped to STDIN of cmd1. Q: On top of this, how can I also pipe STDOUT of cmd1 to STDIN of cmd0? Is it mandatory to use redirect ...
18
votes
4answers
4k views

How to pass a password to a child process?

Passing a password on command line (to a child process started from my program) is known to be insecure (because it can be seen even by other users with ps command). Is it OK to pass it as an ...
2
votes
1answer
711 views

Pseudo-terminals vs. a pair of pipes

Why are pseudo-terminals a seperate feature on Unix-like systems? What makes them superior to a pair of pipes or FIFOs for implementing terminal emulators?
1
vote
1answer
674 views

where does go data written to file descriptor that was never opened

I have output captured by following command: $ strace -f -e trace=process,socketpair,open,close,dup,dup2,read,write -o rsync.log rsync -avcz --progress src/ dst/ it is a bit long so I've uploaded it ...
1
vote
0answers
687 views

strace for troubleshooting inter process communication

I have output captured by following command: strace -f -e trace=process,socketpair,open,close,dup,dup2,read,write -o rsync.log rsync -avcz --progress src/ dst/ it is a bit long so I've uploaded it ...
-3
votes
1answer
836 views

How to do inter process communication using single bidirectional pipe in linux?

How do 2 processes communicate by using single bidirectional pipe, such that both the ends of the pipe could read and write.
3
votes
2answers
1k views

What core kernel-level IPC mechanisms exist in Linux?

Off the top of my head, I know there are: pipes FIFO files / named pipes message queues shared memory semaphores signals Is that the complete list? Doing a bit of research, I think it may be, but I ...
2
votes
1answer
256 views

Why are there no LSM hooks in the POSIX IPC APIs?

As I understand it, the Linux Security Module (LSM) framework has many hooks which are callbacks for security modules to register functions performing additional security checks before security-...
10
votes
3answers
804 views

How to implement “generators” like $RANDOM?

The special variable $RANDOM has a new value every time it's accessed. In this respect, it is reminiscent of the "generator" objects found in some languages. Is there a way to implement something ...