[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: |
Martin Pala |
Subject: |
Re: Best practice for dealing with missing pidfile while service is running |
Date: |
Fri, 5 Feb 2016 09:26:00 +0100 |
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