i have been using sudo sytemctl start mongod for while without having issues but lately whenever i run the same command to start mongodb and try to check the status i keep getting this failed message.
mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-10-19 20:11:41 WAT; 47min ago
Docs: https://docs.mongodb.org/manual
Process: 5770 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=48)
Main PID: 5770 (code=exited, status=48)
Oct 19 20:11:40 systemd[1]: Started MongoDB Database Server.
Oct 19 20:11:41 systemd[1]: mongod.service: Main process exited, code=exited, status=48/n/a
Oct 19 20:11:41 systemd[1]: mongod.service: Failed with result 'exit-code'.
I have been able to fixed the issue. @steevej
The mongod service process tries to run on the same port and this was as a result of previously running mongod service with root privileged on ubuntu.
i had to kill the process on the port mongod service is listening to without worrying if the service has been started by another user.