I just don’t get the whole thing. My process tree: I want to make a process group (3, 4, 5), and send this group a signal from, say, 2. I tried it this way: Where should I place my setpgid() block? I tried placing it in 3, 0 and every other process, but setpgid()s return either “No such process” or
Tag: process
How to distinguish same jars started from different directories?
I started several (eight) jar files with the same name from different directories and different config files. Now I have to kill a specific one. But neither jps and ps gives enough information to distinguish them. How could I find out which java process was started from which directory? Platform : linux (ubuntu server) Answer from the man page it
Sending signals to a linux process and intercepting them
I have a following bash script: If run it and from other terminal send the SIGINT to it, it does nothing. I am using kill -2 pid where pid is the pid of the running script. If I hit CTRL+C (SIGINT) in terminal where the script is running it kills itself and writes the message. How come, it is not
Start background processes from a background process
I have a PHP script say test.php in linux Ubuntu, in this PHP script I use shell_exec() to start several background processes. When I execute php test.php, the background processes are started as expected, but when I run php test.php &, those several background processes are not started. Is it not a supported way to start background processes from a
Tracking php process on framework
I have a php framework is running on linux machine basicly every requests redirect to index.php by .htaccess One of my php started to run %100 CPU i want to track which progress is that but when i check process with ps aux | grep 23791 As normal, request redirect to index.php.But i have to find which request is this.
opening a shell and interacting with its I/O in java
I am trying to open a shell (xterm) and interact with it (write commands and read the shell’s output) Here is a sample of code which won’t work: When I execute this program an “xterm” window opens and the “ls” command is not entered. Only when I close the window I get a “-1” printed and nothing is read from
How Linux handles threads and process scheduling
I’m trying to understand how Linux handles process scheduling and thread scheduling. I read that Linux can schedule both processes and threads. Does Linux have a thread scheduler AND a process scheduler? If yes, how do they cooperate? Answer The Linux kernel scheduler is actually scheduling tasks, and these are either threads or (single-threaded) processes. So a task (a task_struct
Wait until a certain process (knowing the “pid”) end
I have this: Then i do this: I think this is not the best way to wait for the process to terminate, there must be some function wait or something, but i can’t find it. Disclaimer: The process is not a child process Answer I’m not really a Python programmer, but apparently Python does have os.waitpid(). That should consume less
Determine programmatically if a program is running
In C, how can I find out programmatically if a process is already running on Linux/Ubuntu to avoid having it start twice? I’m looking for something similar to pidof. Answer You can walk the pid entries in /proc and check for your process in either the cmdline file or perform a readlink on the exe link (The following uses the
How to extract process hierarchy information in linux? [closed]
It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. I want to write a program in Linux which by getting a session