# Logstash not stopping/restarting

**URL:** <https://discuss.elastic.co/t/logstash-not-stopping-restarting/45249>\
**Category:** Logstash\
**Created:** [March 23, 2016, 4:06pm UTC](https://discuss.elastic.co/t/logstash-not-stopping-restarting/45249 "2016-03-23T16:06:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeface](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mikeface](https://discuss.elastic.co/u/mikeface)\
**Post date:** [March 23, 2016, 4:06pm UTC](https://discuss.elastic.co/t/logstash-not-stopping-restarting/45249/1 "2016-03-23T16:06:17Z")

</div>

I did some searching first, apologies if this has been already covered but I couldn't find it. Running Logstash v2.2.2, on Ubuntu 14.04.3 LT, m3.medium in EC2. When I try to stop or restart, I get:  
Killing logstash (pid 23531) with SIGTERM  
Waiting logstash (pid 23531) to die...  
Waiting logstash (pid 23531) to die...  
Waiting logstash (pid 23531) to die...  
Waiting logstash (pid 23531) to die...  
Waiting logstash (pid 23531) to die...  
logstash stop failed; still running.

If it's a restart, I end up with two logstash processes running. Any ideas how to resolve this? Thanks!

---

<div class="post-metadata">

**Author:** ![marke72](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marke72/32/10832_2.png) [@marke72](https://discuss.elastic.co/u/marke72)\
**Post date:** [March 23, 2016, 6:18pm UTC](https://discuss.elastic.co/t/logstash-not-stopping-restarting/45249/2 "2016-03-23T18:18:49Z")

</div>

They've added an option to allow Logstash to receive a `SIGKILL` if it reaches a timeout period. I think depending on the system you are using and how you install Logstash will determine how to add this option. I installed mine through an RPM in CentOS so the file I would edit is `/etc/sysconfig/logstash`. The very last line has a variable named `KILL_ON_STOP_TIMEOUT`. Setting that variable to 1 sets it so that Logstash will receive a `SIGKILL` after a timeout period. You might be able to edit the service file directly to add that value to the variable as well.  
The only issue with this is that it can result in loss of data just be aware of that.

---

<div class="post-metadata">

**Author:** ![mikeface](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mikeface](https://discuss.elastic.co/u/mikeface)\
**Post date:** [March 28, 2016, 5:22pm UTC](https://discuss.elastic.co/t/logstash-not-stopping-restarting/45249/3 "2016-03-28T17:22:29Z")

</div>

Thanks marke72! That's what I ended up doing. I'd found that option but wasn't sure I wanted to use it.

---

<div class="post-metadata">

**Author:** ![krpatel19](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@krpatel19](https://discuss.elastic.co/u/krpatel19)\
**Post date:** [February 20, 2017, 6:10am UTC](https://discuss.elastic.co/t/logstash-not-stopping-restarting/45249/4 "2017-02-20T06:10:36Z")

</div>

Hi, But is this something that logstash latest support is providing loss of data? I love logstash, But i am not java developer for logstash, LOGSTASH TEAM Could you please solve this issue ASAP? I am in big telecom company, and using it. Same once we start instance it does not stop, and we loss data. Also it is able start n number of instances even if configuration file does not exits, it starts instance. I am talking about logstash 5.2.1 , LATEST LOGSTASH VERSION. Please help us.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:28am UTC](https://discuss.elastic.co/t/logstash-not-stopping-restarting/45249/5 "2017-07-06T04:28:28Z")

</div>


