LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-22-2009, 12:10 AM   #1
finebanana
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
Question does logrotate set size to 1048576 bytes by default if no size is specified?


Hi Folks,

I'm running the stock Apache 2 that comes with CentOS 5.1 and quite puzzled with the behavior of logrotate in rotating the httpd logs. I'm still using the default configs for both apache and logrotate. My problem is that the apache logs (/var/log/httpd/*log) gets rotated based on file size of 1MB but I can't seem to find where this is set.

As I mentioned above, all the config are as is since I havent touch them at all. The logrotate config for httpd doesnt specify how often the rotation will be done nor does it mentioned abt the size:

Code:
# cat /etc/logrotate.d/httpd 
/var/log/httpd/*log {
    missingok
    notifempty
    sharedscripts
    postrotate
        /sbin/service httpd reload > /dev/null 2>/dev/null || true
    endscript
}
so I assume it will be rotated on a weekly basis according to the system-wide logrotate config below:

Code:
# cat /etc/logrotate.conf 
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    minsize 1M
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.
but strangely, the /var/log/httpd/*log gets rotated based on size instead (check out the line the said rotating pattern: /var/log/httpd/*log 1048576 bytes:

Code:
]# /usr/sbin/logrotate -d /etc/logrotate.d/httpd 
reading config file /etc/logrotate.d/httpd
reading config info for /var/log/httpd/*log 

Handling 1 logs

rotating pattern: /var/log/httpd/*log  1048576 bytes (no old logs will be kept)
empty log files are not rotated, old logs are removed
considering log /var/log/httpd/access_log
  log needs rotating
considering log /var/log/httpd/error_log
  log needs rotating
rotating log /var/log/httpd/access_log, log->rotateCount is 0
renaming /var/log/httpd/access_log.1 to /var/log/httpd/access_log.2 (rotatecount 1, logstart 1, i 1), 
renaming /var/log/httpd/access_log.0 to /var/log/httpd/access_log.1 (rotatecount 1, logstart 1, i 0), 
rotating log /var/log/httpd/error_log, log->rotateCount is 0
renaming /var/log/httpd/error_log.1 to /var/log/httpd/error_log.2 (rotatecount 1, logstart 1, i 1), 
renaming /var/log/httpd/error_log.0 to /var/log/httpd/error_log.1 (rotatecount 1, logstart 1, i 0), 
renaming /var/log/httpd/access_log to /var/log/httpd/access_log.1
disposeName will be /var/log/httpd/access_log.1
renaming /var/log/httpd/error_log to /var/log/httpd/error_log.1
disposeName will be /var/log/httpd/error_log.1
running postrotate script
running script with arg /var/log/httpd/*log : "
	/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
"
removing old log /var/log/httpd/access_log.1
removing old log /var/log/httpd/error_log.1
The size limit for httpd is not set at all:

Code:
# grep size /etc/logrotate.d/*?
/etc/logrotate.d/acpid:    size=64k
/etc/logrotate.d/conman:  size=5M
/etc/logrotate.d/yum:    size 30k
Can anyone running CentOS confirm this behavior? Any explaination on this?

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PCI cache line size set incorrectly (32 bytes) by BIOS/FW B1TW1SE Linux - Software 1 08-18-2009 02:43 PM
Can logrotate set limits on archived file size? 0xdefec8 Linux - Server 1 04-05-2008 08:22 PM
PCI cache line size set incorrectly (32 bytes) by BIOS/FW B1TW1SE Linux - Newbie 4 03-30-2008 11:25 PM
set standard/default size of swing JPanel kpachopoulos Programming 4 03-11-2006 08:08 AM
how to set mozilla default font size mfeat Linux - Software 2 05-28-2004 09:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration