1 Dec 01:08
Re: Chroot, piped logging & failure to restart child process
David Fletcher <David <at> megapico.co.uk>
2004-12-01 00:08:44 GMT
2004-12-01 00:08:44 GMT
Hi Ivan & everyone, Re: Chroot, piped logging & failure to restart child process I think I have found a fix for this problem, which can be applied to any piped logging process in the chroot, including rotatelogs. It makes use of the Monit server monitoring package (www.tildeslash.com/monit) which can take action from outside the chroot when the piped logging process dies. This solution isn't as nice as getting everything to 'just work', but I think it is the best I can do for piped logging from the chroot. Monit can easily restart apache, therefore restarting any failed piped logging process. However, Monit has to know that something is wrong, and it is nice if it can find this out *before* the web server begins to lock up. When apache tries to re-start the piped logging process it looks for the binary it was previously running, but on the inside of the chroot. Actually putting a copy of the binary there is a nuisance, and in any case the log files would start going inside the chroot rather than the normal place, which is messy. Much better is to put a simple statically linked binary as a 'fake' rotatelogs on the inside of the chroot. When apache runs this fake rotatelogs, this binary updates a status file (e.g. /tmp/log_fail.txt), which Monit notices by a timestamp change, and the server is automatically re-started. Code for the fake fakerotatelogs.c: ----------------------------------------------------------- #include <stdio.h> #include <stdlib.h>(Continue reading)
RSS Feed