I get the below when running id

$ id
uid=1000(user) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),129(sambashare)

Well I have also tried the below with the correct homedir, using the user ‘user’ but still getting same error:

mongod  --dbpath /home/user/mongodb --logpath /home/user/mongodb/mongod.log --port 27017
2022-03-27T21:06:52.191+0300 F  CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/home/user/mongodb/mongod.log"

I have noticed at least 3 different ownership users which basically own the various directories as below:

  • user:user for directory /home/user/

  • user :root for most directories in / apart from

    • /data owned by mongodb
    • /var/log/mongodb owned by mongodb
    • /var/lib/mongodb owned by mongodb
    • /etc/mongod.conf owned by mongodb

Is there any other file in / that is related to mongod and should change its ownership to mongodb?
Or in any case, does the above structure with their related ownerships sound problematic?