From: LostInTheLoop on
Helmut Hullen, on 07/06/2010 10:47 AM, wrote:

> Just stop and restart the apache. Maybe apache wasn't told
> clearly that "logrotate" should have done more than only
> renaming the logging target.

Tried already last week, even deleting ssl_request_log.1, thus
forcing apache to start using ssl_request_log again.
On sunday morning, at the weekly rotation, apache did it again,
logging on ssl_request_log.1 and leaving the new ssl_request_log empty.
It would make more sense if the thing happened also to access_log
and error_log, but they work flawlessly.
From: jr4412 on
On 6 July, 16:08, LostInTheLoop <bump...(a)ro.und> wrote:
> Helmut Hullen, on 07/06/2010 10:47 AM, wrote:
>
> > Just stop and restart the apache. Maybe apache wasn't told
> > clearly that "logrotate" should have done more than only
> > renaming the logging target.
>
> Tried already last week, even deleting ssl_request_log.1, thus
> forcing apache to start using ssl_request_log again.
> On sunday morning, at the weekly rotation, apache did it again,
> logging on ssl_request_log.1 and leaving the new ssl_request_log empty.
> It would make more sense if the thing happened also to access_log
> and error_log, but they work flawlessly.

have you tried adding 'copytruncate' (as first line) to your '/etc/
logrotate.d/httpd'?
From: Robert Komar on
LostInTheLoop <bumping(a)ro.und> wrote:
> logrotate rotates /var/log/httpd/access_log and
> /var/log/httpd/ssl_request_log. Everithing works fine for
> access_log, but apache goes on writing on the old ssl_request_log,
> now renamed with ".1". The new ssl_request_log remains empty.
>
> This is /etc/logrotate.d/httpd:
>
> /var/log/httpd/*_log {
> postrotate
> /etc/rc.d/rc.httpd graceful-stop
> /etc/rc.d/rc.httpd start
> endscript
> }
>
> Any idea? TIA

I think your problem is with "graceful-stop". As long as some
connections are still open, then logging for those will continue
to the old file. Check out the man page for apachectl for more
info.

Cheers,
Rob Komar
From: Helmut Hullen on
Hallo, LostInTheLoop,

Du meintest am 05.07.10:

> Hi,

> logrotate rotates /var/log/httpd/access_log and
> /var/log/httpd/ssl_request_log. Everithing works fine for
> access_log, but apache goes on writing on the old ssl_request_log,
> now renamed with ".1". The new ssl_request_log remains empty.

> This is /etc/logrotate.d/httpd:

> /var/log/httpd/*_log {
> postrotate
> /etc/rc.d/rc.httpd graceful-stop
> /etc/rc.d/rc.httpd start
> endscript
> }

Where have you got that logrotate script?

httpd-2.2.15 shows (as last lines)

...
sharedscripts
postrotate
/etc/rc.d/rc.httpd restart
endscript
}


Viele Gruesse
Helmut

"Ubuntu" - an African word, meaning "Slackware is too hard for me".

From: John F. Morse on
LostInTheLoop wrote:

> On sunday morning, at the weekly rotation, apache did it again,
> logging on ssl_request_log.1 and leaving the new ssl_request_log empty.
> It would make more sense if the thing happened also to access_log
> and error_log, but they work flawlessly.


That trouble is sounding more and more familiar each time you add a
little bit of additional information. ;-)

A year ago I had a similar log rotation problem which I managed to fix
-- except for Sunday mornings.

Different distro and server software though, but please allow me to
explain. There might be some clue to a common problem.

I was using Ubuntu 8.04 LTS Server Edition (PAE kernel, extra two years
support for a total of five, no GUI, etc.). I chose it because it was a
Long Term Support release, and since it was built on the Debian Testing
branch, it had the latest package versions as well.

This distro and release version works fine except for the one bug that I
documented in the log rotate bug report shown at:

https://bugs.launchpad.net/ubuntu/+source/inn2/+bug/374843

The bug was never fixed nor even acknowledged by Canonical (Ubuntu),
although as you can see, two other INN news server administrators did
see the same problem.

My final solution was to use Debian Lenny instead of Ubuntu, which
rotates the logs correctly.

My Debian Lenny news servers also have apache2 running and all log
rotation is working fine. I've added a Debian Squeeze box (the "Testing"
branch of Debian), and it too is rotating the INN and apache2 log files
as expected.

The Debian Lenny (5.0.4) running INN 2.4.5:

kent(a)optima5:~$ sudo apache2 -V
Server version: Apache/2.2.9 (Debian)
Server built: Apr 19 2010 19:56:21
Server's Module Magic Number: 20051115:15
Server loaded: APR 1.2.12, APR-Util 1.2.12
Compiled using: APR 1.2.12, APR-Util 1.2.12
Architecture: 32-bit

The Debian Squeeze (6.0 "Testing") running INN 2.5.2 (built from source
to use the latest):

kent(a)n102:~$ sudo apache2 -V
Server version: Apache/2.2.15 (Debian)
Server built: Apr 25 2010 08:53:31
Server's Module Magic Number: 20051115:24
Server loaded: APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture: 32-bit


Perhaps Slackware uses the same sysklogd, syslogd, klogd, or whatever to
rotate logs? I do have Slackware 10.1 and Slackware 13, but don't use
either of them for news server duty.

Although I use TLS/SSL on the newer Debian Squeeze box, I don't use SSL
for apache2, and do not have any ssl_request_log in /var/log nor in
/var/log/apache2.

Looking on the Slackware 13 box, I don't see ssl_request_log anywhere on
that system (apache2 is not installed), nor anything in /var/log/httpd/
either. So I can't compare or investigate without installing apache2.

The Slackware 13 /etc/logrotate.conf file mentions that logrotate should
be run from root's crontab, so it may be a permissions problem.

I like the language in the /etc/logrotate.conf comment near the bottom,
which states: "This is intentional, and it should not be." Huh? Neither
Debian nor Ubuntu use such confusing language in their
/etc/logrotate.conf file, and don't have that comment. ;-)

You may find a clue in the information which the other news admins
provided in their reply to my Ubuntu bug report.

One admin mentioned in the news.software.nntp newsgroup that he was
using syslog-ng as a replacement, and it didn't have the log rotate
problem. Maybe that would work for you?

He also switched to Ubuntu 9.04 and didn't have the problem (but 9.04 is
not a LTS release). The latest Ubuntu 10.04 is an LTS, but the Debian
Lenny and Squeeze boxen are working fine, so why fix it if it ain't
broken? ;-)

If you want to follow that thread, and can find it still available on a
news server, it's titled "Logging failures" and was started on Wed, 06
May 2009 12:46:40 -0000.

Good luck, and please let us know what you find.


--
John

When a person has -- whether they knew it or not -- already rejected the Truth, by what means do they discern a lie?
First  |  Prev  | 
Pages: 1 2
Prev: Re (2): What am I doing wrong ?
Next: MySQL version