I’m writing a chatbot that (besides other features) allows the admin to send custom message to instant message apps via a DBus call. The chatbot creates a service org.cdpa.cdpachan on the system bus, exposes the interface org.cdpa.bot_send_message and the method send_message. I’m able to get any user to register the service name with the configuration file /usr/share/dbus-1/system.d/org.cdpa.cdpachan.conf But sending DBus
Tag: ipc
“Loose” inter process communication
I have two programs (namely dwm and slock). I want to trigger a function in dwm depending on events happening in slock and vice versa. The requirement is that both should be independent and run without the other program and also work together. What is the easiest and/or the best (most efficient) IPC solution/method? Answer I’ve done it like Milag
Segmentation fault error as the reader tries to read from the shared memory
I am trying to understand the System V shared memory APIs. I created a small program where one writes into the shared memory and another reads from the shared memory. But for some reason, I am getting an error : as I try to read from the shared memory. I could not find the reason for it. Here is what
Wait for signal from parent and does job and blocks again
Write a program that can display a text string (consisting only of the 26 alphabets and spaces). The program should fork 27 worker processes. Each worker process runs an infinite loop in which it waits for a signal from the controller (i.e., parent), sleeps for 1 sec, prints its pre-defined character, signals the controller, then blocks again. The controller reads
How and when are interrupt key combination,such as CTRL-C, translated to signals?
Using a Linux OS, I need to transparently pass all keystrokes from remote connections to local hardware connections. This is fairly straight forward for everything but signals. I know I can register handlers for each signal that capture and pass the keystroke, but this seems like a hack that might not work for edge cases (what if someone changes the
How many maximum shared memory keys can be created using ftok() in linux?
I am creating share memory keys using ftok(). I want to create 500 share memory keys.As per man page of ftok() it is mentioned that low order 8 bits are significant. Does it mean that we can only generate 256 maximum share memory keys? If yes, Then how to generate more than 256 keys? Because in argument ftok() is defined
Signal all processes in process group except self
I am writing a program which multiple processes will run concurrently. In this program, there is a need for one process to suspend all other participants temporarily. In order to spare myself the overhead of tabulating all participant process ID’s in a shared page and signaling them individually, I have created a process group that all participants join. To suspend
Equivalent to named pipes in Unix for LIFO/Stack structure
I have been looking at all the different types of Unix file: regular files, directories, device files, symbolic link, doors, socket, named pipes,… but I couldn’t find a file type that would behave like a stack/LIFO structure. As most of you know, the advantage of FIFO/named pipe over regular files is the following: from https://askubuntu.com/questions/449132/why-use-a-named-pipe-instead-of-a-file Almost everything in Linux can
Get notified about process termination
I’m trying to use NETLINK with CN_IDX_PROC to monitor my process. This works but requires the monitoring process to be launched with root privileges. I’ve tried to fix it by setting a capability in the filesystem on my monitoring executable (including CAP_AUDIT_READ, CAP_SYS_ADMIN,CAP_SYS_PTRACE and CAP_IPC_OWNER), but it didn’t work, bind() still fails saying “Operation not permitted” unless using sudo to
Select() to read in sockets
I have a client server client connection where the server reads the message sent by the client every 1 second but I do not want the server to keep on waiting for a message for too long. I tried using the select() function but the server continues waiting for some message to read. Could anyone tell me what I am