Skip to content

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&#8…

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 …

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 (…