## issue sumary 
I specificed `datadir` in conf file and run bitcoind with `-conf` option, but data is writing to default `~/.bitcoin` dir , not the dir I want  

## steps to reproduce
**bitcoind version 0.17.1**
```
root@MNG-BC ➜  .bitcoin bitcoind --version
Bitcoin Core Daemon version v0.17.1.0-gef70f9b52b851c7997a9f1a0834714e3eebc1fd8
```

### step1: configrations
**bitcoind conf file path `/root/.bitcoin/bitcoin.conf`**
datadir for testnet : **datadir=/mnt/data/bitcoin**
```
# [core]
# Specify the location of the configuration file. To use non-default location, create a default location config file containing this setting.
conf=/root/.bitcoin/bitcoin.conf

# [debug]
# Enable debug logging for all categories.
#debug=1
# Log IP Addresses in debug output.
#logips=1
# Run this node on the Bitcoin Test Network.
#testnet=1

# [rpc]
# Accept command line and JSON-RPC commands.
server=1
# Accept public REST requests.
rest=1
# RPC user
rpcuser=rpcuser
# RPC password
rpcpassword=rpcpass
# RPC allow ip (allow all)
rpcallowip=0.0.0.0/0
# RPC bind
#rpcbind=127.0.0.1
# get all transaction
txindex=1


# [Sections]
# Most options automatically apply to mainnet, testnet, and regtest networks.
# If you want to confine an option to just one network, you should add it in the relevant section.
# EXCEPTIONS: The options addnode, connect, port, bind, rpcport, rpcbind and wallet
# only apply to mainnet unless they appear in the appropriate section below.

# Options only for mainnet
[main]
# datadir
datadir=/mnt/data/bitcoin/mainnet
# Listen for incoming connections on non-default port.(default: 8333 or testnet: 18333)
port=8333
# RPC port(default:8332 or testnet:18332)
rpcport=8332

# Options only for testnet
[test]
# datadir
datadir=/mnt/data/bitcoin
# Listen for incoming connections on non-default port.(default: 8333 or testnet: 18333)
port=18333
# RPC port(default:8332 or testnet:18332)
rpcport=18332

# Options only for regtest
[regtest]
```

### step2 : run bitcoind
run bitcoind with below command  
```
bitcoind -conf=/root/.bitcoin/bitcoin.conf -testnet=1
```

### step3 : check the data
expected all the data write to /mnt/data/bitcoin/testnet3  
but actually block data is been wroted to /root/.bitcoin/   
```
drwx------  2 root root 4096 Apr  4 16:51 blocks
drwx------  3 root root 4096 Apr  4 16:51 testnet3
```

more info about the contents in /root/.bitcoin 
```
root@MNG-BC ➜  .bitcoin du --max-depth=1 -h
1.1G    ./testnet3
4.0K    ./blocks
1.1G    .
root@MNG-BC ➜  .bitcoin cd testnet3
root@MNG-BC ➜  testnet3 ls
blocks
root@MNG-BC ➜  testnet3 cd blocks
root@MNG-BC ➜  blocks ls
blk00000.dat  blk00001.dat  blk00002.dat  blk00003.dat  blk00004.dat  blk00005.dat  blk00006.dat  blk00007.dat  index  rev00000.dat  rev00001.dat  rev00002.dat  rev00003.dat  rev00004.dat  rev00005.dat  rev00006.dat  rev00007.dat
```

## question
Why datadir is not taken effect in conf? Is it a bug or my conf is wrong?  Should I specific `-datadir` option in the command line?  

{
    SetupHelpOptions(gArgs);
    const auto defaultBaseParams = CreateBaseChainParams(CBaseChainParams::MAIN);
    const auto testnetBaseParams = CreateBaseChainParams(CBaseChainParams::TESTNET);
    const auto regtestBaseParams = CreateBaseChainParams(CBaseChainParams::REGTEST);
    gArgs.AddArg("-version", "Print version and exit", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-datadir=<dir>", "Specify data directory", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)", false, OptionsCategory::OPTIONS);
    SetupChainParamsBaseOptions();
    gArgs.AddArg("-named", strprintf("Pass named instead of positional arguments (default: %s)", DEFAULT_NAMED), false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpcclienttimeout=<n>", strprintf("Timeout in seconds during HTTP requests, or 0 for no timeout. (default: %d)", DEFAULT_HTTP_CLIENT_TIMEOUT), false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpcconnect=<ip>", strprintf("Send commands to node running on <ip> (default: %s)", DEFAULT_RPCCONNECT), false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpccookiefile=<loc>", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u, testnet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpcwait", "Wait for RPC server to start", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to bitcoind). This changes the RPC endpoint used, e.g. http:127.0.0.1:8332/wallet/<walletname>", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
    gArgs.AddArg("-stdinrpcpass", "Read RPC password from standard input as a single line. When combined with -stdin, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
}
static void libevent_log_cb(int severity, const char *msg)