monit-general
[Top][All Lists]
Advanced

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

Re: Best practice for dealing with missing pidfile while service is runn


From: Bill Durant
Subject: Re: Best practice for dealing with missing pidfile while service is running
Date: Fri, 05 Feb 2016 07:31:25 -0800
User-agent: Type for Android

Thank you.  -Bill

On Feb 5, 2016, at 12:26 AM, Martin Pala <address@hidden> wrote:
Hello,

your solution is correct. Alternatively you can also use pattern based process check (no need for pidfile).

Regards,
Martin


On 04 Feb 2016, at 20:11, Bill Durant <address@hidden> wrote:

Greetings:

Is there a best practice for dealing with a situation when a service's
PID file is deleted by something other than the service itself?

For example, given the following monit rule:

check process ntpd with pidfile /var/run/ntpd.pid
start program "/etc/init.d/ntpd start"
stop program "/etc/init.d/ntpd stop"

If /var/run/ntpd.pid is deleted by the root user from the command line,
then monit will start it again resulting in two instances of ntpd.

A workaround that I discovered is to tell monit to 'restart' ntpd
instead of 'starting' it as follows:

check process ntpd with pidfile /var/run/ntpd.pid
start program "/etc/init.d/ntpd restart"
stop program "/etc/init.d/ntpd stop"

Is this a common practice or is there a better way?

Thanks!

Bill


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



reply via email to

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