# After running Elasticsearch from source, I can't shut it down properly

**URL:** <https://discuss.elastic.co/t/after-running-elasticsearch-from-source-i-cant-shut-it-down-properly/189325>\
**Category:** Elasticsearch\
**Created:** [July 8, 2019, 10:25am UTC](https://discuss.elastic.co/t/after-running-elasticsearch-from-source-i-cant-shut-it-down-properly/189325 "2019-07-08T10:25:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hohol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hohol/32/37372_2.png) [@Hohol](https://discuss.elastic.co/u/Hohol)\
**Post date:** [July 8, 2019, 10:25am UTC](https://discuss.elastic.co/t/after-running-elasticsearch-from-source-i-cant-shut-it-down-properly/189325/1 "2019-07-08T10:25:16Z")

</div>

I use Windows 10.  
Sources version is current master (53538747b434eb30ab93e9715bfd120f9521b20b).

I launch Elasticsearch using "gradlew run" command.  
It works fine, there are no errors and I can see a response in the browser.  
Then I press "Ctrl+C" in the terminal. It asks "Terminate batch job (Y/N)?", I print "Y" and it stops.  
However, it seems some processes still linger.

If I try running "gradlew run" again, it fails because files in "distribution\build\cluster\run node0" folder are locked by some process.  
I can't remove this folder manually as well. I can do it only after finding and killing the process that uses it.

Am I doing something wrong?  
What is the proper way to shut down Elasticsearch?

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [July 12, 2019, 7:02pm UTC](https://discuss.elastic.co/t/after-running-elasticsearch-from-source-i-cant-shut-it-down-properly/189325/2 "2019-07-12T19:02:54Z")

</div>

Running `curl -XGET "http://localhost:9200/_nodes/process"` should give you process id, which you can use with taskkill or just use Task Manage to begin with.

---

<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 9, 2019, 7:10pm UTC](https://discuss.elastic.co/t/after-running-elasticsearch-from-source-i-cant-shut-it-down-properly/189325/3 "2019-08-09T19:10:57Z")

</div>

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