How to properly terminate a bitcoin-qt process?

0

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?

Denja

Posted 2018-02-20T16:08:25.663

Reputation: 180

Answers

1

kill <PID> should just work fine.

Jannes

Posted 2018-02-20T16:08:25.663

Reputation: 5 823

Not the answer I look for cause I already used that one. My blockchain got corrupted.Denja 2018-03-01T18:23:55.113

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 2018-03-02T13:12:04.957

1@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 2018-04-01T15:03:36.617

0

My answer is no different to the answer by Jannes, 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/

Willtech

Posted 2018-02-20T16:08:25.663

Reputation: 2 657

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 2018-04-01T15:02:07.083

@PieterWuille I was looking at the OP error: bitcoin-qt: cannot connect to xserverWilltech 2018-04-01T16:06:44.933

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 2018-04-01T17:02:04.623

@PieterWuille is receiving another SIGTERM handled if bitcoin-qt is already on the shutting down process window?Willtech 2018-04-01T22:55:08.033