Apache failed and Monit did not restart it as expected. The error in monit's log is:
Error opening Monit id file '/root/.monit.id' 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?
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:
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.