Start the process with the name

Basically, I want to dynamically start some processes that can create their own child processes, and I also want to kill a certain group of processes that I just created when I want. One way I could come up with is to start processes with a name (to distinguish it from a group), and then use pkill to kill them by name. The question is how to start a process with a name so that I can use pkill to kill them by name? I am also open to other solutions.

+5
source share
2 answers

There is a very similar serverfault question with some answers that may help you

+3
source

?

bash -c "exec -a <MyProcessName> <Command>"

:

pkill -f MyProcessName

+4

All Articles