Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add signal selection when stopping the process #114

Closed
pevtsoff opened this issue Apr 1, 2017 · 4 comments
Closed

Add signal selection when stopping the process #114

pevtsoff opened this issue Apr 1, 2017 · 4 comments

Comments

@pevtsoff
Copy link

pevtsoff commented Apr 1, 2017

Hi Erik,

If this is possible, would you please add a feature to be able to state a signaly type sent when stopping the process. like this
1.Default stop would still go without parameters and would behave as it does now, which is very good rally
Process(stop)
2.But in case you want to send some particular signal from this ruby list (Signal.list in IRB)
{"EXIT"=>0, "INT"=>2, "ILL"=>4, "ABRT"=>22, "FPE"=>8, "KILL"=>9, "SEGV"=>11, "TERM"=>15}
It would be possible to call stop with parameter like
@process.stop(:sig_int) or
@process.stop(Signal.list['EXIT']) whichever is more appropriat`e for Ruby conventions

This would really help to use this package for automated application testing, as we would need to test like a case that the process finishes gracefully when CTRL+C (INT signal) is received by the process. And I think it would add more flexibility for testing purpose anyway

Thanks a lot
Ivan

@pevtsoff
Copy link
Author

pevtsoff commented Apr 1, 2017

In particular, I'm interested in INT and may be TERM signal, so that I can test if it's correctly handled by our apps in auto test framework

@enkessler
Copy link
Owner

@pevtsoff , I'm not sure that this can be done. Signal.list does not seem to limit its signals based on what the operating system will accept. Process#kill seems to only accept KILL as a valid signal for Windows and after digging around in the project history, the only supported Windows signals seem to be INT, BREAK, and KILL since the project first started. Looking around online, it seems that Windows does not support signals in the same way that Unix-like systems do. Interrupting and breaking may be as graceful as one can get with Windows.

Have you actually successfully sent a TERM signal to a Windows process?

@pevtsoff
Copy link
Author

pevtsoff commented Apr 13, 2017 via email

@enkessler
Copy link
Owner

@pevtsoff I haven't made any progress on this and I don't have any more time to dedicate to investigating it, unfortunately. You can keep poking at it if you want to and if you come up with something then I'm happy to look at a PR. For the moment, however, I'm closing the issue because all signs point to arbitrary signals not being possible on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants