Cannot run daemon as bitcoin user on OS X 10.11 #7845

issue alexreg opened this issue on April 8, 2016
  1. alexreg commented at 9:13 PM on April 8, 2016: contributor

    I attempt the following in the shell:

    $ sudo -u bitcoin -g bitcoin debug=1 /opt/local/bin/bitcoind -conf="/opt/local/etc/bitcoin/bitcoin.conf" -datadir="/opt/local/var/lib/bitcoind" -pid="/opt/local/var/run/bitcoind/bitcoind.pid"
    
    
    ************************
    EXCEPTION: N5boost10filesystem16filesystem_errorE       
    boost::filesystem::status: Permission denied: "/Users/alex/Library/Application Support"       
    bitcoin in AppInit()       
    
    

    What is going on here? I am not trying to do anything under /Users/alex/Library/Application Support. On the contrary, I am running bitcoind as a specialised user/group for the system. Could someone please explain? Maybe there is a path I forget to change?

  2. alexreg commented at 1:38 AM on April 9, 2016: contributor

    Okay, after some debugging I've tracked this down to the call to TryCreateDirectory in GetDefaultDataDir in src/util.cpp. It's not actually clear why for OS X (and just OS X) a function to return a default path should actually try to create that path – surely that should be done elsewhere and only if necessary to put files within that dir. Anyway, this seems to be the problem... though I can't guarantee it's the only point of failure, it's likely to be the main one.

    Do you think we can get this fixed promptly and a new release out, or at least a Git tag? Cheers.

  3. kirkalx commented at 2:25 AM on April 9, 2016: contributor

    Strange, seems to me you are right. Try a PR removing that line and see what happens. The other part of the mystery is due to whatever behaviour sudo has on your version of OSX - presumably it is leaving $HOME set to "/Users/alex".

  4. alexreg referenced this in commit 6b44e42286 on Apr 9, 2016
  5. alexreg commented at 1:53 PM on April 9, 2016: contributor

    Indeed. I've given that a try. Looks to be passing, fingers crossed...

  6. alexreg commented at 4:44 PM on April 9, 2016: contributor

    All good. Patch is working great for me here, locally.

  7. laanwj added the label Mac on Apr 11, 2016
  8. alexreg referenced this in commit 41dbc4849e on Apr 12, 2016
  9. laanwj commented at 11:39 AM on April 14, 2016: member

    Solved by #7850

  10. laanwj closed this on Apr 14, 2016

  11. MarcoFalke referenced this in commit f711640561 on Apr 25, 2016
  12. MarcoFalke referenced this in commit 06c73a1751 on Apr 27, 2016
  13. makevoid referenced this in commit 16fe8d7683 on Jun 13, 2016
  14. nomnombtc referenced this in commit da6397ae77 on Nov 12, 2016
  15. nomnombtc referenced this in commit 3d6cf4ad88 on Nov 12, 2016
  16. nomnombtc referenced this in commit 766dc32428 on Nov 13, 2016
  17. sickpig referenced this in commit 8f1b384654 on Nov 14, 2016
  18. DrahtBot locked this on Sep 8, 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: 2026-04-13 18:15 UTC

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