Cannot run mongod after changing logpath in config file

vagrant@m103:~$ mongod -f /etc/mongod.conf          
about to fork child process, waiting until server is ready for connections.
forked process: 3407
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the "--fork" option.
vagrant@m103:~$ ls -l /var/mongodb/db/mongod.log 
-rw------- 1 vagrant vagrant 0 Sep 24 08:07 /var/mongodb/db/mongod.log

Be sure your logpath is present and set to proper user/group

Hi @Sunanda_Samaddar_30067,

I can see that your logfile is empty, can you please try and run your mongod process in the foreground with all the parameters as used in your config file and let us know what error is being displayed then?

Also on a sidenote, we would suggest you to create your config file elsewhere (preferably in the “/shared” directory) and not in “/etc”.

Thanks,
Muskan
Curriculum Support Engineer

The logpath in the config was /var/log/mongodb/.... not /var/mongodb/....

Hi @Sunanda_Samaddar_30067,

Since now you have the correct log file, please let us know if you were able to find the error and work around it.

If not, please share the contents of the log file so that we can help you put with it.

Thanks,
Muskan
Curriculum Support Engineer

It is solved. Just had to change the path in config file.