On Thu, Aug 21, 2008 at 05:13:22PM +0200, Chris Joelly wrote:
> On Thu, Aug 21, 2008 at 11:59:15AM +0200, Andrew Beekhof wrote:
>> On Aug 21, 2008, at 1:01 AM, Chris Joelly wrote:
>>> i have a question on handling logrotate with services which are
>>> managed using heartbeat / crm:
>>>
>>> if e.g. apache is startet/stopped using the resource manager,
>>> and logrotate restarts it when logrotate rotates the apache
>>> logfiles, how would crm respond to this issue? is crm able to
>>> handle thios correct  
>>> or
>>> is crm seeing a resource failure and then not be able to start
>>> apache again as it is stopped and then restartet outside of crm?
>> 
>> Its entirely up to the apache resource agent.
>> If it reports the apache failed, then we'll restart it.
> 
> ok, i see i messed things up...
> but what is the best practice to handle logrotate triggered
> restarts of services (e.g. apache) which forces the cluster
> software to restart the service using the resource agent?
> 
> is the way to go to use some sort of database logging (using
> mod_log_sql for apache) or for other services use syslog-ng with
> output to databases and disabling logrotate on this services?
> 
> or is there another way staying with the textfile based logging?

Quite intriguing. Most services don't require a restart in order to
rotate logs. However, having done a bit of a quick search, it appears
this likely is the case for Apache 1.x. It looks like a common solution
is to have Apache write its logs via a separate process which handles
rotation without having to restart the server:

  http://httpd.apache.org/docs/1.3/programs/rotatelogs.html

This may contain some useful information as well:

  http://www.freebsddiary.org/rotatelogs.php

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to