def METHOD_NAME():
    # On non-Windows we can use os.setsid() which Windows lacks,
    # to attempt to give Kart it's own process group ID (PGID)
    if "_KART_PGID_SET" not in os.environ and os.getpid() != os.getpgrp():
        try:
            os.setpgrp()
            # No need to do this again for any Kart subprocess of this Kart process.
            os.environ["_KART_PGID_SET"] = "1"
        except OSError as e:
            L.warning("Error setting Kart PGID - os.setpgrp() failed. %s", e)
    # If Kart now has its own PGID, which its children share - we want to SIGTERM that when Kart exits.
    if os.getpid() == os.getpgrp():
        import signal
        _kart_process_group_killed = False
        def _cleanup_process_group(signum, stack_frame):
            nonlocal _kart_process_group_killed
            if _kart_process_group_killed:
                return
            _kart_process_group_killed = True
            try:
                os.killpg(0, signum)
            except Exception:
                pass
            sys.exit(128 + signum)
        signal.signal(signal.SIGTERM, _cleanup_process_group)
        signal.signal(signal.SIGINT, _cleanup_process_group)