reitzig / ltx2any

Yet another LaTeX build wrapper, with one or two nifty features
GNU General Public License v3.0
59 stars 4 forks source link

When cancelling a run, engine processes survive #71

Open akerbos opened 8 years ago

akerbos commented 8 years ago

When we cancel a run with CTRL+C, engine processes that were started are not (always) killed. They even survive termination of the original ltx2any process!

Investigate and resolve.

akerbos commented 8 years ago

Possible solution: store PIDs of all running child processes and skill them explicitly.

http://stackoverflow.com/questions/32965251/how-can-i-kill-process-which-has-spawned-a-child-using-system

Getting the PID is easy: f = IO::popen(...); f.pid
Killing as well: Process.kill("TERM", pid)

akerbos commented 8 years ago

Other possibilty: set up a signal handler.

http://stackoverflow.com/a/14636093/539599

Do we still want to deal with CTRL+C differently is daemon mode is running? Could use this to completely overhaul how signals are processed -- which should probably happen, anyway.