New answers tagged process-management
Here are a few tricks that can help you figure out what's going on: Get the offending process's PID: $ pgrep -a gzip 25267 gzip -c --best file On my system (where I've launched a big gzip job), that returns the single PID: 25267. You might have more than one so, make sure to choose the right one. The -a flag tells pgrep to print the full command line, ...
pstree provides a nicely formatted output displaying what spawned what (assuming the parent does not die immediately after spawning the gzip command) Also check out Is there an easy way to log all commands executed, including command line arguments?
Process tree While the process is running try to use ps with the f option to see the process hierarchy: ps axuf Then you should get a tree of processes, meaning you should see what the parent process of the gzip is. If gzip is a direct descendant of init then probably its parent has exited already, as it's very unlikely that init would create the gzip ...
Solved it by adding the -l flag to pgrep: pgrep -lf sbin From man pgrep: -l, --list-name List the process name as well as the process ID. (pgrep only.)
Have you tried adding -u root to the ps command? This will limit it to just roots processes. i.e. ps -ef -u root | grep sbin. To control the output you need to look at the OUTPUT FORMAT CONTROL section in the man pages. Just play with the flags until you get the desired/acceptable output?
Top 50 recent answers are included