bitcoind wont start with datadir specified in conf file and no home dir #15240

issue d3spwn openend this issue on January 24, 2019
  1. d3spwn commented at 4:04 am on January 24, 2019: none

    bitcoind won’t start if datadir is specified in the conf file and the user running it has no home dir

    tested with debian stretch and bitcoin 0.17.1

     0# sudo -u bitcoin bitcoind -daemon -conf=/usr/local/etc/bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid
     1
     2************************
     3EXCEPTION: N5boost10filesystem16filesystem_errorE
     4boost::filesystem::create_directories: Permission denied: "/home/bitcoin"
     5bitcoin in AppInit()
     6
     7bitcoind: chainparamsbase.cpp:29: const CBaseChainParams& BaseParams(): Assertion `globalChainBaseParams' failed.
     8Aborted
     9
    10# mkhomedir_helper bitcoin
    11
    12# sudo -u bitcoin bitcoind -daemon -conf=/usr/local/etc/bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid
    13Bitcoin server starting
    
  2. fanquake added the label Linux/Unix on Jan 24, 2019
  3. hebasto commented at 5:05 pm on January 25, 2019: member
    @d3spwn could you provide your /usr/local/etc/bitcoin/bitcoin.conf?
  4. d3spwn commented at 6:48 pm on January 25, 2019: none
    0datadir=/var/local/lib/bitcoind
    1txindex=1
    2server=1
    3wallet=xxxx.dat
    
  5. laanwj referenced this in commit 3e1ca1348c on Feb 21, 2019
  6. hebasto commented at 9:27 pm on April 21, 2019: member
    @d3spwn would you mind trying #15864 to fix this issue?
  7. d3spwn commented at 3:52 am on April 25, 2019: none
    I’ll test it within the next few days.
  8. d3spwn commented at 7:36 am on April 28, 2019: none

    note: I deleted my previous reply. I believe this was caused because I didn’t have #15278 merged.

    I’ve tested #15864 and it seems to resolve this issue. bitcoind correctly starts the IBD using the datadir set in the conf file even when the user that is running it has no home dir. When no datadir is provided it still uses the home dir or gives an error when it doesn’t exist.

  9. hebasto commented at 8:19 am on April 28, 2019: member
    @d3spwn Thank you for testing #15864.
  10. egp commented at 4:45 pm on July 5, 2019: none
    Is there a workaround until the PR is released?
  11. MarcoFalke closed this on Aug 19, 2019

  12. sidhujag referenced this in commit 894dd2f309 on Aug 19, 2019
  13. MarcoFalke commented at 3:17 pm on October 12, 2019: member
    I guess it could be backported to 0.18.2
  14. deadalnix referenced this in commit 68cb14deaa on Apr 23, 2020
  15. ShengguangXiao referenced this in commit eee9fd8fa9 on Aug 28, 2020
  16. PastaPastaPasta referenced this in commit 4f0648a09f on Aug 16, 2021
  17. vijaydasmp referenced this in commit 13680a7bbf on Sep 5, 2021
  18. vijaydasmp referenced this in commit 6a2c6ac2a9 on Sep 6, 2021
  19. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-03 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me