guard / guard-spork

Guard::Spork automatically manage Spork DRb servers
https://rubygems.org/gems/guard-spork
MIT License
296 stars 58 forks source link

Fix signal handling #14

Closed gix closed 13 years ago

gix commented 13 years ago

Control signals used by guard terminate child processes used by guard-spork (since they are child processes now to enable debugging).

This pull request fixes this by using fork and exec instead of spawn. This allows to ignore those control signals before calling exec (Spork uses its own SIGINT handler, but we terminate there anyway, so it's not a problem so far).

Testing this automatically is not trivial, so no integration tests yet (I verified it with a small example project locally in spec/integration. I can append it to this pull request if requested.).

thibaudgg commented 13 years ago

Is it still working with ruby debug? Spawn was added for that purpose (https://github.com/guard/guard-spork/pull/11)

gix commented 13 years ago

Yes it does (using spork/ext/ruby-debug). Using fork/exec keeps the process as child process (while system("foo&") used before does not).