I don't know if I'm doing something supported here, but this doesn't seem to work for me:
./src/bitcoind -datadir=/tmp/bitcoin_27302/ -rpcport=18555 -port=18556
2023-03-27T21:22:09Z Default data directory /home/will/.bitcoin
2023-03-27T21:22:09Z Using data directory /tmp/bitcoin_27302/regtest
2023-03-27T21:22:09Z Config file: /tmp/bitcoin_27302/bitcoin.conf
2023-03-27T21:22:09Z Config file arg: datadir="/tmp/bitcoin_27302/datadir2"
2023-03-27T21:22:09Z Config file arg: regtest="1"
2023-03-27T21:22:09Z Command-line arg: datadir="/tmp/bitcoin_27302/"
2023-03-27T21:22:09Z Command-line arg: port="18556"
2023-03-27T21:22:09Z Command-line arg: rpcport="18555"
2023-03-27T21:22:09Z Using at most 125 automatic connections (1024 file descriptors available)
I am specifying -datadir= on the command line (to start with a non-default datadir). This first datadir contains a bitcoin.conf file which contains a second datadir= option, where the second datadir also contains a second bitcoin.conf but I don't see the warning?
The port= option in datadir2/bitcoin.conf is being ignored:
will@ubuntu in /tmp/bitcoin_27302
₿ tree
.
├── bitcoin.conf
├── datadir2
│ └── bitcoin.conf
└── regtest
├── banlist.json
├── bitcoind.pid
├── blocks
│ ├── blk00000.dat
│ ├── index
│ │ ├── 000015.log
│ │ ├── 000016.ldb
│ │ ├── CURRENT
│ │ ├── LOCK
│ │ └── MANIFEST-000013
│ └── rev00000.dat
├── chainstate
│ ├── 000005.ldb
│ ├── 000025.ldb
│ ├── 000027.log
│ ├── CURRENT
│ ├── LOCK
│ └── MANIFEST-000026
├── debug.log
├── fee_estimates.dat
├── mempool.dat
├── onion_v3_private_key
├── peers.dat
├── settings.json
└── wallets
6 directories, 23 files
will@ubuntu in /tmp/bitcoin_27302
₿ cat bitcoin.conf
regtest=1
datadir=/tmp/bitcoin_27302/datadir2
will@ubuntu in /tmp/bitcoin_27302
₿ cat datadir2/bitcoin.conf
port=18557
I don't see yet where the error is here, but suspect I might have short circuited it by providing a -datadir command line option intially?