From: Florian Philipp <lists@binarywings.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] apache: what could cause "graceful restart requested"?
Date: Wed, 03 Aug 2011 18:48:53 +0200 [thread overview]
Message-ID: <4E397BF5.7080003@binarywings.net> (raw)
In-Reply-To: <CA+czFiCtjpUcqWE1wyPFZRvcKfCs48oyS5hvc=UiZy4QnOgmLA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1426 bytes --]
Am 03.08.2011 18:40, schrieb Michael Mol:
> On Wed, Aug 3, 2011 at 12:31 PM, Jarry <mr.jarry@gmail.com> wrote:
>> But is it actually necessary to do it? I mean everything between
>> postrotate-endscript is done after the log file has been rotated.
>
> The log file has been moved, but Apache still holds open the file
> descriptor to the old log file--it will continue writing to that file,
> even under its new name.
>
>> So I do not understand why at that time apache must be reloaded.
>
> The reload causes Apache to close the file descriptor, and then open
> the file again. Since it *opens* the file by name, it will start with
> a fresh log file.
>
>>
>> Moreover, because of that apache-reloading apc was emptied so it
>> takes again some time till all php-scripts are in cache again...
>
> What you really want is for the logrotate script to ask Apache to
> flush its logs and reopen the file. I don't know offhand if Apache has
> a way to do that, short of a graceful restart.
>
I'm not aware of such an option (doesn't mean it doesn't exist, though).
The cleanest solution I can think of is to order apache to send its logs
to syslog. [1] shows how to do this. Of course you still have to reload
syslog-ng when you rotate the log files but apache itself can keep running.
[1] http://oreilly.com/pub/a/sysadmin/2006/10/12/httpd-syslog.html
Hope this helps,
Florian Philipp
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2011-08-03 16:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-03 16:12 [gentoo-user] apache: what could cause "graceful restart requested"? Jarry
2011-08-03 16:17 ` Michael Mol
2011-08-03 16:31 ` Jarry
2011-08-03 16:40 ` Michael Mol
2011-08-03 16:48 ` Florian Philipp [this message]
2011-08-03 16:59 ` Jarry
2011-08-03 16:43 ` Florian Philipp
2011-08-03 16:20 ` Paul Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E397BF5.7080003@binarywings.net \
--to=lists@binarywings.net \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox