Processing
 

monit is not able to read mongod.lock

10/04/2015 12:09#1

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

I am writing a monit script for mongo(in ubuntu). Script given below

check process mongodb   with pidfile "/var/lib/mongodb/mongod.lock"   start program = "/sbin/start mongodb"   stop program = "/sbin/stop mongodb" 

But I am getting error log

monit: Error reading pid from file '/var/lib/mongodb/mongod.lock' 

Please let me know if any work around in monit for this issue.

10/04/2015 12:23Top#2

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

Monit needs a pid file (containing the pid of the mongod process) so you have to create it when you start mongod

#!/bin/bash mongod & echo "$!" > /var/run/mongod.pid 

and set /var/run/mongod.pid as pidfile

10/04/2015 12:22Top#3

marijnz0r

Member

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

I had the same error using MongoDB, this solved my problem: chown -R mongod:mongod /var/lib/mongodb

26/08/2016 03:10Top#4

John Pink

Member

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

A bit late, but I found the pid file here: /var/run/mongodb.pid

Similar articles

Non-interactive method for dpkg-reconfigure tzdata

5 years ago - Reply: 3 - Views: 143

monit is not able to read mongod.lock

2 years ago - Reply: 3 - Views: 141

Ubuntu: hadoop command not found

2 years ago - Reply: 4 - Views: 244

C# Mono Console.ReadLine quitting

4 years ago - Reply: 1 - Views: 87

linking jsoncpp on Ubuntu

2 years ago - Reply: 1 - Views: 6

Build artifacts over ssh jenkins - PHP

3 years ago - Reply: 1 - Views: 38

Can't load Metasploit after installation

3 years ago - Reply: 5 - Views: 222

Selenium FirefoxDriver in Headless get error

2 years ago - Reply: 1 - Views: 97

Unable to start MongoDB. ERROR: addr already in use

2 years ago - Reply: 2 - Views: 120

ZSH Agnoster Theme showing machine name

2 years ago - Reply: 4 - Views: 250

Unable to start firefox browser with jenkins user

2 years ago - Reply: 2 - Views: 113

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re