Author

Topic: bitcoind.pid instance file is not being created (Read 124 times)

hero member
Activity: 1257
Merit: 811
November 30, 2022, 11:21:30 AM
#9
Ok, I solved, thank you so much.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
Remove the local .bitcoin folder (rm -rf /root/.bitcoin).
You may need to add:
Code:
server=1
Why this?

Without it, there is no RPC interface, which is what bitcoin-cli attaches to (or tries to do) to interact with Core.
Code:
bitcoin@localhost:~> bitcoind --help
Bitcoin Core version v22.0
Copyright (C) 2009-2021 The Bitcoin Core developers

Please contribute if you find Bitcoin Core useful. Visit
for further information about the software.
The source code is available from .

This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or


Usage:  bitcoind [options]                     Start Bitcoin Core

Options:

  -?
       Print this help message and exit

[...]

RPC server options:

[...]
  -server
       Accept command line and JSON-RPC commands
hero member
Activity: 1257
Merit: 811
Remove the local .bitcoin folder (rm -rf /root/.bitcoin).
You may need to add:
Code:
server=1
Why this?
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
Quote
/root/bitcoin-core/bin/bitcoind -conf=/mnt/media//.bitcoin/bitcoin.conf -datadir=/mnt/media//.bitcoin -daemon
You may want to add these lines to your bitcoin.conf file; then you don't have to specify it on the command line.

Code:
datadir=/mnt/media//.bitcoin
daemon=1

Remove the local .bitcoin folder (rm -rf /root/.bitcoin).
You may need to add:
Code:
server=1

And tell bitcoin-cli where to find the conf (and thus all the data):
Code:
bitcoin-cli -conf=/mnt/media//.bitcoin/bitcoin.conf getblockchaininfo
hero member
Activity: 1257
Merit: 811
Now I have tried to launch "bitcoin-cli getblockchaininfo" but it is still looking for default data dir:

Quote
cannot create directories: File exists [/root/.bitcoin/wallets] bitcoin in AppInitRPC()

How to change this behaviour?

Here is the content of my "bitcoin.conf" file:

Quote
### IPv4/IPv6 mode ###
# This mode requires uPnP feature on your router to allow Bitcoin Core to accept incoming connections.
bind=0.0.0.0
upnp=1

### Tor mode ###
# This mode requires tor (https://www.torproject.org/download/) to be running at the proxy address below.
# No configuration is needed on your router to allow Bitcoin Core to accept incoming connections.
#proxy=127.0.0.1:9050
#bind=127.0.0.1
#onlynet=onion

listen=1
port=8333
maxconnections=64

dbcache=64
par=2
checkblocks=24
checklevel=0

disablewallet=1

#rpccookiefile=/root/bitcoin-core/.bitcoin/.cookie
rpcbind=127.0.0.1
rpcport=8332
rpcallowip=127.0.0.1

And this is the command I run:
Quote
/root/bitcoin-core/bin/bitcoind -conf=/mnt/media//.bitcoin/bitcoin.conf -datadir=/mnt/media//.bitcoin -daemon
hero member
Activity: 1257
Merit: 811
It was hardcoded in "bitcoin.conf" file, I just removed it and now it works.
As said by n0nce, Bitcoin Core saves the cookie in the data directory... that I passed as parameter to "bitcoind" command.

Thank you for your replies.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
As what user are you running bitcoind?
Your log file hints at running it as root, which I'd highly discourage to do in the first place.

Then, as BlackHatCoiner said, it tries to use / write the cookie to /root/bitcoin-core/.bitcoin/.cookie, as you passed that command-line parameter. Why are you doing that? It's possible that the process just can't write there or the directory /root/bitcoin-core/.bitcoin doesn't exist.
Quote
rpccookiefile="/root/bitcoin-core/.bitcoin/.cookie"

I'd remove this altogether. Bitcoin Core will save the cookie in the data directory, which for all intents and purposes is where it should live.

Also do consider sharing the command-line and / or service file that you use to run Bitcoin Core.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
As far as I can see, you do have set the proper datadir and conf parameters (pointing to your external drive). The problem seems to be your cookie file. It tries to read the .cookie.tmp from the default root directory, and not from your pointed external datadir. It's unable to open it and so it shuts down.

Do you include the cookie location somewhere in the configuration file? Try backing that cookie file up, and delete it. Restart Core afterwards.
hero member
Activity: 1257
Merit: 811
Hello, I have installed Bitcoin Core on Ubuntu 20 and I changed the path of ".bitcoin" folder. When I run "bitcoind" file it does not create "bitcoind.pid" file, as instead it does on another computer.
Since the current instance file is not created the client crashes:

Quote
2022-11-29T16:56:38Z Bitcoin Core version v23.0.0 (release build)
2022-11-29T16:56:38Z Assuming ancestors of block 000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091 have valid signatures.
2022-11-29T16:56:38Z Setting nMinimumChainWork=00000000000000000000000000000000000000002927cdceccbd5209e81e80db
2022-11-29T16:56:38Z Using the 'arm_shani(1way,2way)' SHA256 implementation
2022-11-29T16:56:38Z Default data directory /root/.bitcoin
2022-11-29T16:56:38Z Using data directory /mnt/media//.bitcoin
2022-11-29T16:56:38Z Config file: /mnt/media//.bitcoin/bitcoin.conf
2022-11-29T16:56:38Z Config file arg: bind="0.0.0.0"
2022-11-29T16:56:38Z Config file arg: checkblocks="24"
2022-11-29T16:56:38Z Config file arg: checklevel="0"
2022-11-29T16:56:38Z Config file arg: dbcache="64"
2022-11-29T16:56:38Z Config file arg: disablewallet="1"
2022-11-29T16:56:38Z Config file arg: listen="1"
2022-11-29T16:56:38Z Config file arg: maxconnections="64"
2022-11-29T16:56:38Z Config file arg: par="2"
2022-11-29T16:56:38Z Config file arg: port="8333"
2022-11-29T16:56:38Z Config file arg: rpcallowip="127.0.0.1"
2022-11-29T16:56:38Z Config file arg: rpcbind=****
2022-11-29T16:56:38Z Config file arg: rpccookiefile="/root/bitcoin-core/.bitcoin/.cookie"
2022-11-29T16:56:38Z Config file arg: rpcport="8332"
2022-11-29T16:56:38Z Config file arg: upnp="1"
2022-11-29T16:56:38Z Command-line arg: conf="/mnt/media//.bitcoin/bitcoin.conf"
2022-11-29T16:56:38Z Command-line arg: daemon=""
2022-11-29T16:56:38Z Command-line arg: datadir="/mnt/media//.bitcoin"
2022-11-29T16:56:38Z Using at most 64 automatic connections (32768 file descriptors available)
2022-11-29T16:56:38Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2022-11-29T16:56:38Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2022-11-29T16:56:38Z Script verification uses 1 additional threads
2022-11-29T16:56:38Z Wallet disabled!
2022-11-29T16:56:38Z scheduler thread start
2022-11-29T16:56:38Z HTTP: creating work queue of depth 16
2022-11-29T16:56:38Z Using random cookie authentication.
2022-11-29T16:56:38Z Unable to open cookie authentication file /root/bitcoin-core/.bitcoin/.cookie.tmp for writing
2022-11-29T16:56:38Z Error: Unable to start HTTP server. See debug log for details.
2022-11-29T16:56:38Z Shutdown: In progress...
2022-11-29T16:56:38Z scheduler thread exit
2022-11-29T16:56:38Z Shutdown: done

Do you see any useful hint in this log file? Why the client still use default data directory for some paths?
What could be the problem?

I have also tried versione 24.0, but nothing changed.
Jump to: