MongoDB

mongod.lock

When starting MongoDB server

# mongod --config /etc/mongod.conf

 

a file /var/lib/mongodb/mongod.lock is created. The content in the file is PID (process ID) number, for example 31918.

 

# ps aux | grep mongo

root     31918  0.2  4.3 537976 88720 ?        Sl   16:10   0:00 mongod --config /etc/mongod.conf

 

 

 

When the server is stopped:

# mongod --shutdown --config /etc/mongod.conf

the file is still present but the number is deleted. The file becomes empty.