process pid reuse

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

process pid reuse

Ranjit Noronha
Hi,

I am able to install monit and monitor some of my processes. Monit works very nicely to restart my  processes when they fail.

I am using the pidfile to help recognize the process.

I have a question on process pid reuse.

Suppose a process crashes (seg faults) and its pid get recycled; ie some non-related process comes in with the pid.

The original pid is still in the pidfile created originally.

How does Monit recognize that a pid is recycled and not the original process (so now it should try to restart the original process).

--
thanks,

--ranjit



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: process pid reuse

martinp@tildeslash.com
Hi,

you can use the pattern based process check instead of the pidfile to prevent this problem: https://mmonit.com/monit/documentation/monit.html#Process

Best regards,
Martin


On 2 Aug 2018, at 08:17, Ranjit Noronha <[hidden email]> wrote:

Hi,

I am able to install monit and monitor some of my processes. Monit works very nicely to restart my  processes when they fail.

I am using the pidfile to help recognize the process.

I have a question on process pid reuse.

Suppose a process crashes (seg faults) and its pid get recycled; ie some non-related process comes in with the pid.

The original pid is still in the pidfile created originally.

How does Monit recognize that a pid is recycled and not the original process (so now it should try to restart the original process).

--
thanks,

--ranjit


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general