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*

6
  • Can you show us what you've tried already ? Please edit OP to include the new info. Commented Jun 19, 2022 at 20:50
  • The closest I was able to get to what I want is already in the OP. It can successfully kill the current node processes spawned by my script. I started with killall node and was able to work it out till here (the elif block) Commented Jun 19, 2022 at 21:16
  • You want a completely separate instance of the script to kill processes launched by the first instance? Or do you want to have the same script, which is still running, kill its child processes? Commented Jun 19, 2022 at 23:16
  • @terdon I want a completely separate instance of the script to kill everything launched by my first instance. My script as it currentlly is, does the latter one you described, kills all the child node processes. Commented Jun 19, 2022 at 23:47
  • So how would the script know what processes to kill? What if something else launched a node process? Do you just want to kill all running node processes irrespective of who started them? Are you just looking for killall node or pkill node? Commented Jun 19, 2022 at 23:53