# Logstash stuck after Restart/Stop command

**URL:** <https://discuss.elastic.co/t/logstash-stuck-after-restart-stop-command/310797>\
**Category:** Logstash\
**Created:** [July 27, 2022, 8:45pm UTC](https://discuss.elastic.co/t/logstash-stuck-after-restart-stop-command/310797 "2022-07-27T20:45:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oriya](https://avatars.discourse-cdn.com/v4/letter/o/2bfe46/32.png) [@Oriya](https://discuss.elastic.co/u/Oriya)\
**Post date:** [July 27, 2022, 8:45pm UTC](https://discuss.elastic.co/t/logstash-stuck-after-restart-stop-command/310797/1 "2022-07-27T20:45:52Z")

</div>

Hi,  
i have a logstash server (8.1.3 version) with 3 pipelines.  
each pipeline configure with jdbc to collect data from sql server.  
everything works ok until i try to execute the :  
`"systemctl restart logstash"`  
and it's seems like the logstash is stuck.  
in the log i see :

```auto
Jul 27 21:07:17 ******************** systemd[1]: Stopping logstash...
Jul 27 21:07:17 ******************** logstash[2370313]: [2022-07-27T21:07:17,482][WARN][logstash.runner] SIGTERM received. Shutting down.

```

and in the command :  
`"systemctl status logstash"` i see :

```auto
● logstash.service - logstash
   Loaded: loaded (/etc/systemd/system/logstash.service; enabled; vendor preset: disabled)
   Active: deactivating (stop-sigterm) since Wed 2022-07-27 21:07:17 IDT; 2h 36min ago
 Main PID: 2370313 (java)

```

what is the SIGTERM means and why my logstash behave like that ?

thanks!

---

<div class="post-metadata">

**Author:** ![Ofir\_Edi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ofir_edi/32/78181_2.png) [@Ofir\_Edi](https://discuss.elastic.co/u/Ofir_Edi)\
**Post date:** [July 28, 2022, 2:45pm UTC](https://discuss.elastic.co/t/logstash-stuck-after-restart-stop-command/310797/2 "2022-07-28T14:45:04Z")

</div>

Hi @Oriya ,  
Usually it means that Logstash is trying to shutdown but due to active threads it takes a while to shutdown gracefully. You can get more information looking at logstash log files (by default located at /var/log/logstash/logstash-plain.log) rather than systemctl outputs.  
in case you want to shutdown Logstash non-gracefully you can do the following:

```auto
ps -ef | grep logstash
sudo kill -9 <pid from prevoius command>

```

- Bear in mind that shutting down Logstash non-gracefully may result in data loss.

---

<div class="post-metadata">

**Author:** ![Oriya](https://avatars.discourse-cdn.com/v4/letter/o/2bfe46/32.png) [@Oriya](https://discuss.elastic.co/u/Oriya)\
**Post date:** [July 31, 2022, 9:48pm UTC](https://discuss.elastic.co/t/logstash-stuck-after-restart-stop-command/310797/3 "2022-07-31T21:48:30Z")

</div>

Hi @Ofir_Edi ,  
Thank you for your detailed answer, you helped me a lot.

---

<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:** [August 28, 2022, 9:48pm UTC](https://discuss.elastic.co/t/logstash-stuck-after-restart-stop-command/310797/4 "2022-08-28T21:48:42Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
