I use recoll to index files and it kicks in a inopportune times.When I use htop to change the view to a tree view using F5 and filter the process list I see a master process running and child processes underneath it. When I press F9 to choose a termination option it doesn't seem to respond to the SIGTERM option so I have to use the SIGKILL option.Is there an option to pause or stop the parent process and all its children rather than kill it outright?
How can htop be used to suspend a process and all its child processes?
process management;htop
You can press Space to tag a process. The kill command applies to all tagged processes.There's no easy way to tag a process and its children, but the tree view (t) should list them contiguously.Depending on how recoll is run, the processes may be in their own process group. If they are, then you can use kill -STOP -1234 to suspend them all, where 1234 is the process group ID (usually but not necessarily the process ID of the initial process in the group). You can check with ps -o pid,ppid,pgid,comm -C recoll, then ps -o pid,ppid,pgid,comm ww | grep -v recoll to see if there are any other processes in the process group. Htop doesn't have an interface to process groups.If all the processes are called recoll, then an easier method is to filter the processes by name. In htop, use the filter command, then you can easily tag the processes you want to kill. On the command line, run ps $(pgrep recoll) to list the matching processes. If you're happy with the list, run pkill -STOP recoll to suspend those processes.