-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
service logstash restart does not take KILL_ON_STOP_TIMEOUT into account #4991
Comments
+1 with additional information, cross-post from the forums... When logstash doesn't stop in a timely manner, the init script exits with a bug trying to handle the timeout, and when calling it with restart, it ends up starting multiple copies. sudo service logstash restart Seen in version 2.3.1 on ubuntu 14 LTS The relevant line in the code is... if [ $KILL_ON_STOP_TIMEOUT -eq 1 ] ; then Addtionally, after reviewing the code further, when the else clause to the line with the bug fires, the script should not start another copy. The stop function should return an error so that "stop && start" does not do the start. |
I checked out the source code in anticipation of submitting a patch for this, and I found that 'KILL_ON_STOP_TIMEOUT' does exist in the stock defaults file that ships with logstash, so the problem is when puppet installs the defaults file it doesn't get included. The default should exist in the script so that if not present in the defaults file the script doesn't bug out trying to check the value. My soon to be released patch will reflect this. I also renamed the variable to start with LS to match the other variables. |
@KnightOfNight thanks much! I would love to include your patch in 2.3.2 which will happen next week. |
…dded code to the stop function to handle inability to stop when not forcing Fixes elastic#4991
…dded code to the stop function to handle inability to stop when not forcing Fixes elastic#4991, elastic#5168
…dded code to the stop function to handle inability to stop when not forcing Fixes elastic#4991, elastic#5168
currenly still not worked on ubuntu 14.04 because init.d/logstash have #!/bin/sh in first line |
@Slach I'm not sure I understand. Why is having |
http://stackoverflow.com/questions/3411048/unexpected-operator-in-shell-programming when i run Killing logstash (pid 20736) with SIGTERM |
There's a bug in the patch, it should either use |
@Slach I have stackoverflow blackholed, so I can't read that link. Reviewing the patch, I see a bug. Bourne shell equality operator is a single equal sign, not double. |
yep bug in line 100, need = |
BASH is either = or ==, but /bin/sh is just =, and I failed to notice the shell at the top of the script. I'll fix and PR again. |
@KnightOfNight thank you much :) |
this error has resurfaces somehow, working on proper issue for this. |
Tested with: Ubuntu 14.04 package when calling
service logstash restart
the script does not take into account the varKILL_ON_STOP_TIMEOUT
leaving former LS instance alive.see:
this might happen when LS resist to stop, for example when there is an stale output.
The expected workaround for this is to use
start
andstop
when using the KILL_ON_STOP_TIMEOUT.The text was updated successfully, but these errors were encountered: