[GRASS-dev] pygrass: How to allow Ctrl-C to stop all subprocesses of GridModule

Glynn Clements glynn at gclements.plus.com
Tue Mar 13 12:07:41 PDT 2018


Moritz Lennert wrote:

> Any hint how to allow Ctrl-C to stop all subprocesses ?

If you can get their PIDs, you should be able to use os.setpgid() to
move them into the same process group as the main script. Ctrl-C (by
default) sends SIGINT to all processes in the foreground process
group.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list