Unable to start mongodb 2.6.12 as a systemd service in rhel 7.9

I am unable to start mongo db as a systemd service whereas the process runs when executing the start cmd in command line.

I am attaching th status error below.

systemctl status mongod.service -l
● mongod.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/etc/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2022-01-01 10:17:09 EST; 9s ago
  Process: 57350 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
 Main PID: 57350 (code=exited, status=100)

 Started High-performance, schema-free document-oriented database.
2022-01-01T10:17:09.539-0500 ** WARNING: --rest is specified without --httpinterface,
2022-01-01T10:17:09.539-0500 **          enabling http interface
warning: bind_ip of is unnecessary; listens on all ips by default
about to fork child process, waiting until server is ready for connections.
forked process: 57352
ERROR: child process failed, exited with error number 100
mongod.service: main process exited, code=exited, status=100/n/a
Unit mongod.service entered failed state.
mongod.service failed.
1 Like

Check mongod.log for more details
Could be permissions issues on your dbpath/logpath dirs
Does the user running systemd have proper privileges?

Logs showing nothing about systemd errors. I am using mongod user and it is owner of logpath as well as dbpath.
Could you please mention what is the proper privilege for running systemd?

I have found where the issue is.
I have to add PIDFile path in mongod.service file which i added only in mongod.conf.

After adding i have restarted the systemd service and it is running now.


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.