Thanks Lutz I did not realise that we can delay the starting of the service if the pidfile is not selected. The documentation suggests (at least to me) that the only option available is to start the service when the pidfile isn't detected:
CHECK PROCESS <unique name> <PIDFILE <path> | MATCHING <regex>> ... If the pid-file does not exist or does not contain the PID number of a running process, Monit will call the entry's start method if defined. -- -----Original Message----- From: [email protected] <[email protected]> On Behalf Of Lutz Mader Sent: 31 July 2025 20:04 To: This is the general mailing list for monit <[email protected]> Subject: Re: Monit starting processes when they are updating Hello Jamie, as long as the application update is fast, you can delay the application (re)start. check process Postgres with pidfile /var/run/pgsql/data.pid onreboot laststate : if not exist for 5 cycles then start You will get an alert if the application is down and a restart will wait five cycles. On the other hand, you can monitor the application log file and disable/enable the monitoring for the application based on the messages. You will find some suggestion in the wiki also, see https://mmonit.com/wiki/Monit/HowTo Lutz
