def _terminate_all(self) -> None:
        """Terminates the main process and all its children."""
        for p in self._child_processes:
            p.send_signal(self._termination_signal)
        os.kill(self._main_pid, self._termination_signal)
Terminates the main process and all its children.
src/lightning/fabric/strategies/launchers/subprocess_script.py