[Top][All Lists]

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

Apache, rotatelogs & chroot environment

From: David Fletcher
Subject: Apache, rotatelogs & chroot environment
Date: Mon, 29 Nov 2004 23:12:39 +0000


I have an interesting problem in which Monit may be able to help. I want to
monitor the child processes of a server process, and use these to decide
when to restart the parent.

The details:

I have Apache running in a chroot jail using mod_security to manage the
chroot. This allows the apache binaries and libraries to lie outside the
chroot, which contains only the web pages to be served.

Logging from the httpd process takes place using the piped logging
mechanism through the"rotatelogs" program which comes with Apache.
Rotatelogs is started as a child of Apache during server start-up. The log
files are opened before the chroot operation, and they lie outside the

In a non-chroot server, if the "rotatelogs" process fails then Apache
will restart it. However, for the chroot server, Apache cannot restart
rotatelogs because it cannot find the rotatelogs binary, which lies outside
the jail.

The main apache process is already monitored using Monit. I want to use
Monit to check that the child rotatelogs process is also running, and to
restart Apache (the parent) if it is not. Rotatelogs does not produce a pid
file, but I could fix this using a pid generating wrapper. However,
multiple copies of rotatelogs are usually running, for ssl_log, error_log,
access_log etc.

Can Monit check multiple copies of rotatelogs, each with a different pid?
I'm not sure how to manage pid files for multiple copies of the same

Can Monit be configured to restart httpd if the child rotatelogs
process stops running, even though there can be no "stop" and "start"
statements for rotatelogs itself?

I hope the problem is clear - let me know any ideas.


Email: address@hidden

reply via email to

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