Skip to content
Advertisement

Tag: process

Grouping child processes with setpgid()

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

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

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.

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

Advertisement