I think that my theory may hold water, from /etc/init.d/httpd
# When stopping httpd a delay of >10 second is required before SIGKILLing
the
# httpd parent; this gives enough time for the httpd parent to SIGKILL any
# errant children.
stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile} -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
Nick Upson
On 10 September 2012 12:56, Nick Upson <[email protected]> wrote:
> I've just found a server where monit has been attempting to restart httpd
> for several days.
>
> the monit config entry is:
>
> check process apache with pidfile /var/run/httpd.pid
> start program = "/etc/init.d/httpd start"
> stop program = "/etc/init.d/httpd stop"
>
> output in the monit.log is:
>
> [BST Sep 5 18:55:07] debug : monit: pidfile '/var/run/httpd.pid' does
> not exist
> [BST Sep 5 18:55:07] error : 'apache' process is not running
> [BST Sep 5 18:55:07] info : 'apache' trying to restart
> [BST Sep 5 18:55:07] debug : monit: pidfile '/var/run/httpd.pid' does
> not exist
> [BST Sep 5 18:55:07] debug : monit: pidfile '/var/run/httpd.pid' does
> not exist
> [BST Sep 5 18:55:07] info : 'apache' start: /etc/init.d/httpd
> [BST Sep 5 18:55:07] debug : monit: pidfile '/var/run/httpd.pid' does
> not exist
> [BST Sep 5 18:55:07] debug : monit: pidfile '/var/run/httpd.pid' does
> not exist
> [BST Sep 5 18:55:37] error : 'apache' failed to start
>
> I think what is happening is that the restart and the start execution are
> over-lapping such that the removal of the pid file
> by the restart happens after the separate start. Why a restart is being
> attempted I do not understand.
>
> This was corrected on the server by doing a manual kill of the httpd
> processes
>
>
> and, BTW, reporting that the pid file does not exist as part of starting a
> process is, at best, redundant
> and at worse, confusing
>
>
>
> Nick Upson
>
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general