I need to have a single instance program in Linux. That is if someone tries to run the program the new instance should print a message and exit. At the moment I have a lock mechanism like this: The problem is if I do anything that spawns child processes using int system(const char *command); and at some point, someone uses
Tag: child-process
spawn strace command with Node.js child_process
Since I’m not happy with this approach and I got no answers, I’m trying another method to track the output of an already running program. I based this code on this Unix Stack Exchange and what I’m trying to do is just retrieve the log information of a program that is already running. Obs: to use strace without sudo you
Linux best practice to start and watch another process
In my process I need to start/restart another process. Currently I use a thread with a tiny stack size and the following code: I feel like that’s not best practice. I have no idea about the resources the std::system() call is blocking or wasting. I’m on an embedded Linux – so in general I try to care about resources. Answer
How to Obtain Youngest Child’s PID from task_struct
I’m working on a project that involves writing a new system call for Linux 3.18.20. This system call is supposed to store various information about the currently running process in a newly defined struct. One of the fields of the struct is the PID of the process’s youngest child, and I’ve been searching for information about this in the struct