--conf confused by relative path #6506

issue unsystemizer opened this issue on August 3, 2015
  1. unsystemizer commented at 10:30 AM on August 3, 2015: contributor
    rippler@ubuntu:~$ bitcoin-0.10.2/bin/bitcoind --conf=.bitcoin/bitcoin.testnet.conf
    Error: To use bitcoind, or the -server option to bitcoin-qt, you must set an rpcpassword in the configuration file:
    /home/rippler/.bitcoin/.bitcoin/bitcoin.testnet.conf <=====  !!!
    It is recommended you use the following random password:
    rpcuser=bitcoinrpc
    rpcpassword=CW3JUTEkBSzuFj2RGHuFtWsSkfuB23RoNGHBp6woQ9oe
    (you do not need to remember this password)
    The username and password MUST NOT be the same.
    If the file does not exist, create it with owner-readable-only file permissions.
    It is also recommended to set alertnotify so you are notified of problems;
    for example: alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com
    
    rippler@ubuntu:~$ ll .bitcoin/bitcoin.testnet.conf
    -rw------- 1 rippler rippler 102 Aug  3 03:21 .bitcoin/bitcoin.testnet.conf
    rippler@ubuntu:~$ pwd
    /home/rippler
    

    Note that my config file isn't under /home/rippler/.bitcoin/.bitcoin/, but rather under /home/rippler/.bitcoin/. $ bitcoin-0.10.2/bin/bitcoind --conf=/home/rippler/.bitcoin/bitcoin.testnet.conf works fine.

  2. laanwj commented at 5:46 PM on August 3, 2015: member

    Only absolute paths are supported for configuration options. Probably needs a check.

  3. laanwj added the label Bug on Aug 3, 2015
  4. laanwj added the label Priority Low on Aug 3, 2015
  5. casey commented at 6:12 PM on August 3, 2015: contributor

    Actually it looks like relatives paths are supported for configuration options. -conf, -pid, and -wallet accept relative paths which are interpreted as relative to the data directory. (-wallet only supports relative paths)

    So the current behavior seems to be consistent. It would be nice if it was documented somewhere that relative paths are interpreted as relative to the data directory, but I'm not sure where the best place to put that would be.

  6. laanwj commented at 6:56 PM on August 3, 2015: member

    Oops, -wallet is not supposed to accept paths at all (the database must be in the 'database environment', which is always the data dir), just file names.

    For -conf and -pid you are right, GetConfigFile and GetPidFile has explicit code to prepend the datadir. Could be better documented. I wasn't aware either. In a way this makes sense, it makes it easy to specify an alternative config file within the datadir. Though the interaction is a bit convoluted: the configuration file specified using -conf can in turn override -datadir :-)

    Closing as expected behavior, then.

  7. laanwj closed this on Aug 3, 2015

  8. unsystemizer commented at 6:11 AM on August 4, 2015: contributor

    Created #6512

  9. MarcoFalke locked this on Sep 8, 2021
Labels

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-17 06:15 UTC

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