[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Monit not able to start after box reboot

From: Fei, Yuming
Subject: Monit not able to start after box reboot
Date: Mon, 11 Jun 2012 16:24:07 -0500

Hi all,

I have seen a problem that monit is not able to start after the box reboot. The monit is run from init as daemon.

This problem happens occasionally. When it does happen, I saw these:


First of all, the file was not removed after the box shutdown.

Then monit was started from init, but it wrote “monit daemon at 12327 awakened” into its log, where 12327 is the pid in The monit startup process then exited and no monit process run.


Cleaning up the file helped: restart monit after the cleaning up, then monit came up.


Anyone has experienced this? What could cause this to happen?


Looking at monit’s source code, I found these:


(1) the removal function of the pid file is registered in atexit(), however it may not be called if  the process terminates abnormally. Thus the pid file may not be removed, which is probably what was seen above.

(2) When monit starts up, it retrieves the pid value from the pid file, and calls getpgid to check the result. But if the process with that pid is running as a zombile, the getpgid checking will pass and monit thinks that the monit daemon is running, and will “awake” that daemon which is actually a zombie. The result is that monit daemon won’t come up.


It doesn’t seem that monit tests if there is a monit zombie process during startup.

Also, if by any chance there is a process running with the same pid in the, monit will send a signal to it to “awake” it …, and then it may kill that process.


This is seen in monit 5.1.1, and seems to be in the latest version 5.4 as well.





The contents of this message and any attachments may be confidential and proprietary. If you are not an intended recipient, please inform the sender of the transmission error and delete this message immediately without reading, distributing or copying the contents.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]