<p>My answer is no different to the answer by Jannes, just with more explanation.</p>

<p>If you key: <code>kill PID</code> then if no signal specified in the kill command, signal # 15 (SIGTERM), is sent by default. This is the same as <code>kill -15 PID</code> and is considered safe, so you can specify SIGTERM manually if you like. If this cannot close your process without corruption then it was probably inevitable.</p>

<p>Note that upon closing, bitcoin-qt opens a new GUI window for the close process, with the do not shut down your computer message.</p>

<p>It may be a better solution to try and revive your GUI session before you exit bitcoin-qt.</p>

<p>Note that if you starte bitcoin-qt with the correctly configured <code>-server</code> option you can use <code>bitcoin-cli stop</code> to close bitcoin-qt.</p>

<p>rel:<br>
nixCraft - Kill Process in Linux or Terminate a Process in UNIX / Linux Systems - <a href="https://www.cyberciti.biz/faq/kill-process-in-linux-or-terminate-a-process-in-unix-or-linux-systems/" rel="nofollow noreferrer">https://www.cyberciti.biz/faq/kill-process-in-linux-or-terminate-a-process-in-unix-or-linux-systems/</a></p>

CC BY-SA 3.0
2018-04-01T15:02:07.083Z
There is no reason why the "do not shut down" window couldn't be created, given that there already is an existing window.
Pieter Wuille
CC BY-SA 3.0
2018-04-01T16:06:44.933Z
@PieterWuille I was looking at the OP error: bitcoin-qt: cannot connect to xserver
Willtech
CC BY-SA 3.0
2018-04-01T17:02:04.623Z
Yes, that's expected. He can't run bitcoin-qt from an environment without xserver. But the *existing* bitcoin-qt process clearly does have an environment with an xserver, and will open windows there.
Pieter Wuille
CC BY-SA 3.0
2018-04-01T22:55:08.033Z
@PieterWuille is receiving another SIGTERM handled if bitcoin-qt is already on the shutting down process window?
Willtech
CC BY-SA 3.0
2018-04-01T13:35:45.623Z
2018-04-01T22:53:42.643Z
2018-04-01T22:53:42.643Z
Willtech
<p><code>kill &lt;PID&gt;</code> should just work fine.</p>

CC BY-SA 3.0
2018-03-01T18:23:55.113Z
Not the answer I look for cause I already used that one.
My blockchain got corrupted.
Denja
CC BY-SA 3.0
2018-03-02T13:12:04.957Z
That's a bit weird. Are you sure it does not get corrupted when you normally close it? https://superuser.com/questions/406920/linux-close-a-program-with-command-line-not-kill-it
Jannes
CC BY-SA 3.0
2018-04-01T15:03:36.617Z
@Denja How long did you wait? Bitcoin Core may take seconds or even minutes to flush all its caches at shutdown time. If you can't see the UI it may be best to watch debug.log file to see when it is safely shut down.
Pieter Wuille
CC BY-SA 3.0
2018-02-20T18:15:10.847Z
2018-02-20T18:15:10.847Z
Jannes
<p>I run my bitcoin-qt on headless raspberrypi where it runs pretty smoothly.<br>
The Issue starts when Marco gui crashes <i>via vnc</i> so the Bitcoin-qt GUI is hanging although that deamon is still running as a process when i check with <br><br>
<code>ps -ax | grep bitcoin</code><br><br>
In short I can't access the gui and close it normaly
the only way to still access is through ssh and I tried<br><br>
<code>bitcoin-qt stop</code><br>
<b>bitcoin-qt: cannot connect to xserver</b></p>

<p>What is the proper way to terminate/stop safely my bitcoin-qt process? </p>

<bitcoin-core><bitcoin-qt-setup><raspberry-pi><command-line-options>
How to properly terminate a bitcoin-qt process?
Denja
# How to properly terminate a bitcoin-qt process?

(Asked by: username_0 on 2018-02-20)

I run my bitcoin-qt on headless raspberrypi where it runs pretty smoothly.  
The Issue starts when Marco gui crashes *via vnc* so the Bitcoin-qt GUI is hanging although that deamon is still running as a process when i check with   
  
`ps -ax | grep bitcoin`  
  
In short I can't access the gui and close it normaly
the only way to still access is through ssh and I tried  
  
`bitcoin-qt stop`  
**bitcoin-qt: cannot connect to xserver**

What is the proper way to terminate/stop safely my bitcoin-qt process?

**Tags:** bitcoin-core, bitcoin-qt-setup, raspberry-pi, command-line-options


---

## 2 answers

### Answer by username_1 on 2018-04-01. Score: 1

My answer is no different to the answer by username_3, just with more explanation.

If you key: `kill PID` then if no signal specified in the kill command, signal # 15 (SIGTERM), is sent by default. This is the same as `kill -15 PID` and is considered safe, so you can specify SIGTERM manually if you like. If this cannot close your process without corruption then it was probably inevitable.

Note that upon closing, bitcoin-qt opens a new GUI window for the close process, with the do not shut down your computer message.

It may be a better solution to try and revive your GUI session before you exit bitcoin-qt.

Note that if you starte bitcoin-qt with the correctly configured `-server` option you can use `bitcoin-cli stop` to close bitcoin-qt.

rel:  
nixCraft - Kill Process in Linux or Terminate a Process in UNIX / Linux Systems - <https://www.cyberciti.biz/faq/kill-process-in-linux-or-terminate-a-process-in-unix-or-linux-systems/>

> **Comments:**
> **username_2**: There is no reason why the "do not shut down" window couldn't be created, given that there already is an existing window.  
> **username_1**: @username_2 I was looking at the OP error: bitcoin-qt: cannot connect to xserver  
> **username_2**: Yes, that's expected. He can't run bitcoin-qt from an environment without xserver. But the *existing* bitcoin-qt process clearly does have an environment with an xserver, and will open windows there.  
> **username_1**: @username_2 is receiving another SIGTERM handled if bitcoin-qt is already on the shutting down process window?  

---

### Answer by username_3 on 2018-02-20. Score: 1

`kill <PID>` should just work fine.

> **Comments:**
> **username_0**: Not the answer I look for cause I already used that one. My blockchain got corrupted.  
> **username_3**: That's a bit weird. Are you sure it does not get corrupted when you normally close it? https://superuser.com/questions/406920/linux-close-a-program-with-command-line-not-kill-it  
> **username_2**: @username_0 How long did you wait? Bitcoin Core may take seconds or even minutes to flush all its caches at shutdown time. If you can't see the UI it may be best to watch debug.log file to see when it is safely shut down.  

---

