It still does not work
and the /var/log/mongodb/mongod.log seems empty.
sudo -u mongodb /usr/bin/mongod --auth --config /etc/mongod.conf
sudo vim /var/log/mongodb/mongod.log
sudo -u mongodb /usr/bin/mongod --auth --config /etc/mongod.conf
sudo systemctl status mongod
● mongod.service - MongoDB Database Server
> Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
> Active: failed (Result: exit-code) since Τετ 2022-03-23 20:49:30 EET; 2min 56s ago
> Docs: https://docs.mongodb.org/manual
> Process: 27417 ExecStart=/usr/bin/mongod --auth --config /etc/mongod.conf (code=exited, status=1/FAILURE)
> Main PID: 27417 (code=exited, status=1/FAILURE)
>
systemd[1]: Started MongoDB Database Server.
systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mongod.service: Unit entered failed state.
systemd[1]: mongod.service: Failed with result 'exit-code'.
I suppose the logs are saved somewhere else so tried to find where with the below, but I am not sure if it correctly used:
grep -r 'mongod.service: Main process exited, code=exited, status=1/FAILURE' *