[SERVER-186] Write mongoDB PID to a file Created: 27/Jul/09  Updated: 12/Jul/16  Resolved: 28/Jul/09

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 0.9.3, 0.9.4, 0.9.5, 0.9.6
Fix Version/s: 0.9.7

Type: New Feature Priority: Minor - P4
Reporter: Crazy PoPs Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

It would be nice if mongoDB could write it's PID in a file so it can be monitored by tools like monit.



 Comments   
Comment by Pawe? T?cza [ 17/Mar/11 ]

And this is my Monit config for MongoDB on Ubuntu box (I believe it works for Debian as well):

check process mongodb with pidfile /db/path/mongod.lock
group database
start program = "/etc/init.d/mongodb start"
stop program = "/etc/init.d/mongodb stop"
if failed host 127.0.0.1 port 28017 protocol http
and request "/" with timeout 10 seconds then restart
if 5 restarts within 5 cycles then timeout

I hope it can be useful for other users too. Of course, they need to comment out "nohttpinterface = true" line in their /etc/mongodb.conf file

Comment by Pawe? T?cza [ 17/Mar/11 ]

Eliot, thanks a lot for the hint! I need the PID file for my Monit too

Comment by Eliot Horowitz (Inactive) [ 28/Jul/09 ]

it puts the pid in mongod.lock in the data dir

Generated at Thu Feb 08 02:53:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.