[gentoo-user] logrotate trouble

2005-02-17 Thread Grant
logrotate doesn't seem to be rotating my logs properly and I'm having
some apache2 problems that must be related to my use of postrotate in
logrotate.conf.

In logrotate.conf I have this:

daily
rotate 4
create
include /etc/logrotate.d
notifempty
nomail
noolddir

Are "daily" and "rotate n" defaults?  The configuration examples I've
seen specify "daily" and "rotate n" in the log config sections.

My log config sections are like this:

/var/log/apache2/access_log {
daily
rotate 99
postrotate
/etc/init.d/apache2 restart
endscript
}

for access_log, ssl_access_log, ssl_request_log, error_log, and
ssl_error_log with apache2 restarting for each.  I'm thinking that is
pretty bad.  Can anyone give me any pointers on this?

- Grant

P.S. logrotate.conf came with this:

/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}

What is that?

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] logrotate trouble

2005-02-17 Thread Guilheme Cirne
On Thursday 17 February 2005 16:42, Grant wrote:
<...>
> My log config sections are like this:
>
> /var/log/apache2/access_log {
> daily
> rotate 99
> postrotate
> /etc/init.d/apache2 restart
> endscript
> }
>
> for access_log, ssl_access_log, ssl_request_log, error_log, and
> ssl_error_log with apache2 restarting for each.  I'm thinking that is
> pretty bad.  Can anyone give me any pointers on this?

You could do something like this:

/var/log/apache2/access_log /var/log/apache2/ssl_access_log 
/var/log/apache2/ssl_request_log, 
error_log /var/log/apache2/ssl_error_log {
daily
rotate 99
sharedscripts
postrotate
/etc/init.d/apache2 restart
endscript
}

The sharedscripts option means that the postrotate script will only be 
executed once for all files. So apache will only be restarted once.

-- 
Guilherme Cirne
[EMAIL PROTECTED]

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] logrotate trouble

2005-02-17 Thread Grant
> > My log config sections are like this:
> >
> > /var/log/apache2/access_log {
> > daily
> > rotate 99
> > postrotate
> > /etc/init.d/apache2 restart
> > endscript
> > }
> >
> > for access_log, ssl_access_log, ssl_request_log, error_log, and
> > ssl_error_log with apache2 restarting for each.  I'm thinking that is
> > pretty bad.  Can anyone give me any pointers on this?
> 
> You could do something like this:
> 
> /var/log/apache2/access_log /var/log/apache2/ssl_access_log 
> /var/log/apache2/ssl_request_log,
> error_log /var/log/apache2/ssl_error_log {
> daily
> rotate 99
> sharedscripts
> postrotate
> /etc/init.d/apache2 restart
> endscript
> }
> 
> The sharedscripts option means that the postrotate script will only be
> executed once for all files. So apache will only be restarted once.

Got it, thank you!

- Grant

> Guilherme Cirne

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] logrotate trouble

2005-02-17 Thread darren kirby
quoth the Guilheme Cirne:
> On Thursday 17 February 2005 16:42, Grant wrote:
> <...>
>
> > My log config sections are like this:
> >
> > /var/log/apache2/access_log {
> > daily
> > rotate 99
> > postrotate
> > /etc/init.d/apache2 restart
> > endscript
> > }
> >
> > for access_log, ssl_access_log, ssl_request_log, error_log, and
> > ssl_error_log with apache2 restarting for each.  I'm thinking that is
> > pretty bad.  Can anyone give me any pointers on this?
>
> You could do something like this:
>
> /var/log/apache2/access_log /var/log/apache2/ssl_access_log
> /var/log/apache2/ssl_request_log, error_log /var/log/apache2/ssl_error_log
> {
> daily
> rotate 99
>  sharedscripts
> postrotate
> /etc/init.d/apache2 restart
> endscript
> }


Or more succinctly:
/var/log/apache2/*log
{
 daily
 rotate 99
 sharedscripts
  postrotate
   /etc/init.d/apache2 restart
 endscript
}
> The sharedscripts option means that the postrotate script will only be
> executed once for all files. So apache will only be restarted once.

-- 
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972


pgp7nruW5lXLF.pgp
Description: PGP signature