Unable to stop (with Ctrl-C) logstash and embedded ElasticSearch
Description
Gliffy Diagrams
Activity

Philippe Weber June 22, 2012 at 2:51 PM
CanBeClosed
Mizuno replaced by FTW so this issue should be solved now.
Jordan Sissel October 25, 2011 at 7:18 AM
Alternately, instead of removing the 'trap' method, could be easier instead to wrap 'trap' (with method aliasing) and have it ignore all calls that come from mizuno (inspect 'caller' to see where we are being invoked from)
Jordan Sissel October 25, 2011 at 7:17 AM
Thinking a bit about this, I'm not totally sure how to proceed. Some options:
monkeypatch the webserver (doesn't look trivial: https://github.com/matadon/mizuno/blob/master/lib/mizuno/http_server.rb#L72
Replace Kernel::trap with a dummy function that does nothing, so mizuno cannot trap SIGINT.
use another webserver (seems less awesome)
fork mizuno (not a pleasant option)
send patches to disable the SIGINT stuff which someone probably wants to keep
I think the best option is probably to replace 'trap' with a bogus method, making it so only logstash can capture SIGINT.
Jordan Sissel October 4, 2011 at 4:37 AM
This is mainly due to a misfeature in the webserver logstash uses. It steals SIGINT handling so logstash cannot use it.
It's on my todo list to fix it. In the meantime, SIGTERM will work. I'll fix this soon
Victor Hooi October 4, 2011 at 3:52 AM
heya,
I can confirm I appear to have this issue as well.
I start logstash with:
[victorhooi@myhost Downloads]$ sudo java -jar logstash-1.1.0beta3-monolithic.jar agent -f mylogstash.conf – web --backend elasticsearch:///?local
(I need to use sudo in order to read /var/log/*.log).
Then, when I use Ctrl-C to kill it, it simply prints out:
2011-10-05 00:46:45.318:INFO::stopped o.e.j.s.ServletContextHandler{/,null}
and I need to manually kill the terminal to kill it.
Cheers,
Victor
This is how I start Logstash:
java -jar logstash-1.0.17-monolithic.jar agent -f mylogstash.conf – web --backend elasticsearch:///?local
and it runs fine, but when I press Ctrl-C I get this:
2011-09-12 15:10:19.002:INFO::stopped o.e.j.s.ServletContextHandler{/,null}
and then nothing else. ElasticSearch stops responding after this, but the process never stops. I have to manually kill it. I tried to run it without ElasticSearch and then I can stop it.