Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Apache failed and Monit did not restart it as expected. The error in monit's log is:

Error opening Monit id file '/root/' for writing-Cannot allocate memory

The problem is that Apache went down due to a lack of memory so... is there simply nothing to be done in such a case? The lack of memory killed both the process and the thing monitoring that process.

Anyone know of any strategies for working with such a situation in Monit?

share|improve this question
up vote 1 down vote accepted

I usually change the default Monit ID file location to something like: /var/monit/id

Depending on the version and distribution of your Monit package, the default ID file location can vary. In the current RPMForge package of Monit 5.4, I'm seeing:

set idfile /var/monit/id

That may help in this case. Some people also try to play tricks to keep Monit running (like spawning from inittab), but I really haven't felt the need to do this. Using a more sane ID file location usually resolves my issues.

share|improve this answer
Thanks. I've tried this (moving that file to a dir in /var). We'll see if it helps. – Lothar_Grimpsenbacher Aug 1 '12 at 0:24

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.