Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am seeing something weird that I can not figure out:

If i run the following command

sudo mongod --dbpath /db/database/ --logpath /db/logs/mongodb/mongodb.log &

and then do a

ps aux

I see the following

enter image description here

So I have two mongod processing running now (ignore the third with the --configsrv option)

Why is this happening?

share|improve this question
I think the nature of the processes is answered below, but I will say this: do not start MongoDB as root, do not use sudo to run MongoDB - or any database for that matter - it is a bad, bad idea. If you switch to another user, as you should, you will have to manually fix the ownership on the various data files before the new user will be able to successfully start. – Adam C Nov 14 '13 at 22:34
up vote 1 down vote accepted

2137 is not a mongod process, it is a sudo process and mongod ... are the arguments to sudo.

I think it is probably sticking around because mongod is leaving some file descriptors open.

Try doing ps -e f and you will see the process tree view.

If you really want that sudo to exit you could try something trickier like

sudo sh -c 'mongod --dbpath blah blah &'

and see if that works. Good luck, let us know what you find!

share|improve this answer
thanks for this! much appreciated – Joseph Misiti Dec 4 '13 at 20:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.