We use sysutils/monit (and M/Monit) to control several services. Since version 5.12.2 there's a delay of several minutes when shutting down a service. For example, we have the following in monitrc: check process apache with pidfile /var/run/httpd.pid start program = "/usr/local/etc/rc.d/apache22 start" with timeout 60 seconds stop program = "/usr/local/etc/rc.d/apache22 stop" if cpu > 60% for 2 cycles then alert if cpu > 80% for 5 cycles then alert if cpu > 90% for 6 cycles then restart if totalmem > 14000.0 MB for 5 cycles then alert if totalmem > 15000.0 MB for 5 cycles then restart if children > 750 then alert if failed host 172.17.40.104 port 80 protocol http and request "/system/" for 2 cycles then restart if 3 restarts within 15 cycles then timeout group server A "monit stop apache" takes several minutes for Apache to actually start shutting down. This causes problems with our automated deployment scripts. With previous versions the shutdown happened immediately after issuing "monit stop apache". A normal '/usr/local/etc/rc.d/apache22 stop' stops the service almost immediately. Version 5.12.1 did not exhibit this behavior, all versions (5.12.2, 5.13 and 5.14) after it do. For the time being I've downgraded to Monit 5.12.1. (This may need to be fixed upstream)
Did you raise this problem upstream?
Hello, the problem is fixed in the next Monit release (5.15), which should be available ca. within 1-2 weeks. Best regards, Martin
If anyone would like to propose that the port is fixed locally prior to the next release, *and* there is a relatively well isolated changeset upstream that addresses the fix, don't hesitate to provide references to it, or ideally, an svn diff against the monit port adding a patch to files/ Otherwise please provide alternative instructions for issue resolution
Created attachment 162077 [details] fix for monit-5.14 Hello, the patch for monit-5.14 is attached. Best regards, Martin
A commit references this bug: Author: mat Date: Wed Oct 21 14:17:11 UTC 2015 New revision: 399918 URL: https://svnweb.freebsd.org/changeset/ports/399918 Log: Fix slow shutdown. PR: 201919 Submitted by: maintainer Sponsored by: Absolight Changes: head/sysutils/monit/files/patch-src_http.c head/sysutils/monit/files/patch-src_monit.c