mongod ignores mongod.conf on macOS

Hello!

I am trying to run mongod on macOS Sonoma on an M2 with the following command line:

mongod -f /opt/homebrew/etc/mongod.conf

The conf looks like this:

  destination: file
  path: /opt/homebrew/var/log/mongodb/mongo.log
  logAppend: true
processManagement:
   fork: true
storage:
  dbPath: /opt/homebrew/var/mongodb
net:
  bindIp: 127.0.0.1
  port: 3000

But the logs show this:

"MongoDB starting","attr":{"pid":19298,"port":27017,"dbPath":"/data/db"

So the port and dbPath are not read from the config file.

If I much around in that .conf file and make it invalid or add some invalid value, the mongod runtime tells me the conf is invalid. This means it can read the file but seemingly just ignores it?

Running mongod with --dbpath set to something else changes the dbPath, but running with both -f pointing to that config AND --dbpath shows the same as above.

Any reason for why this happens?

Thanks,
Gustav