# Gracefully Stopping Logstash & Avoiding kill-9

**URL:** <https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197>\
**Category:** Logstash\
**Created:** [May 22, 2015, 11:45pm UTC](https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197 "2015-05-22T23:45:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Kleiner](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@David\_Kleiner](https://discuss.elastic.co/u/David_Kleiner)\
**Post date:** [May 22, 2015, 11:45pm UTC](https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197/1 "2015-05-22T23:45:41Z")

</div>

Hello,

Once in a while I need to restart logstash. I use SV for service management. Here's what happens:

```
[woot@log04 elasticsearch]$ sudo sv stop /etc/service/backend-indexnode*
timeout: run: /etc/service/backend-indexnode: (pid 13160) 67217s, want down, got TERM
timeout: run: /etc/service/backend-indexnode-2: (pid 13117) 67217s, want down, got TERM
timeout: run: /etc/service/backend-indexnode-3: (pid 13136) 67217s, want down, got TERM

```

I end up using kill -9.

Is there anything I can do to get logstash to obey less drastic measures?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 24, 2015, 2:06am UTC](https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197/2 "2015-05-24T02:06:07Z")

</div>

What OS, what LS version?

---

<div class="post-metadata">

**Author:** ![jordansissel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jordansissel/32/44957_2.png) [@jordansissel](https://discuss.elastic.co/u/jordansissel)\
**Post date:** [May 24, 2015, 2:55am UTC](https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197/3 "2015-05-24T02:55:09Z")

</div>

For some background, Logstash will already act on SIGINT and SIGTERM to start a safe shutdown. If safety cannot be achieved, logstash will wait for that safety to become available. This can cause Logstash to get stuck on shutdown if that safety never becomes possible.

---

<div class="post-metadata">

**Author:** ![David\_Kleiner](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@David\_Kleiner](https://discuss.elastic.co/u/David_Kleiner)\
**Post date:** [May 24, 2015, 5:18pm UTC](https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197/4 "2015-05-24T17:18:39Z")

</div>

Thank you Mark and Jordan. I'm using LS 1.5GA on a CentOS 6 box.

---

<div class="post-metadata">

**Author:** ![Nick\_Malcolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_malcolm/32/44776_2.png) [@Nick\_Malcolm](https://discuss.elastic.co/u/Nick_Malcolm)\
**Post date:** [May 25, 2015, 12:05am UTC](https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197/5 "2015-05-25T00:05:42Z")

</div>

I experience this too. Ubuntu 14.04.2 LTS, 1.5.0-rc3.

---

<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, 5:39am UTC](https://discuss.elastic.co/t/gracefully-stopping-logstash-avoiding-kill-9/1197/6 "2017-07-06T05:39:24Z")

</div>


