Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • What language are you writing in? Commented Nov 20, 2018 at 11:18
  • Do you want to include also the "grandchildren etc.", i.e. if your script spawns process A, would children of process A be included in your tracking? Commented Nov 22, 2018 at 9:29
  • Yes, I would need the grandchildren too. Basically the subtree rooted at my wrapper application process. Commented Nov 22, 2018 at 9:41
  • 1
    I hope you're aware that a) a process can get rid of its parent (escape the process tree) by fork + exit b) you can start a process inside another unrelated process of the same user with ptrace eg. gdb -p PID -batch -ex 'p system("command")'. Commented Nov 22, 2018 at 19:29
  • Yes, and that is why I was exploring #2 -> ability to listen to a process being forked right away. Commented Nov 23, 2018 at 8:57