LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-20-2011, 05:47 AM   #1
mgai7755
Member
 
Registered: Apr 2011
Posts: 41

Rep: Reputation: 2
Log file rotation problem


Hi,

Since some weeks I remarked that my "active" log files weren't ".log" files anymore but ".log.1" files instead. The .log files are remaining empty. Logrotate doesn't help.

I must have done something wrong but I don't know what.

Anybody could help me ?

Thanks

Matthieu
 
Old 04-20-2011, 07:04 AM   #2
mgai7755
Member
 
Registered: Apr 2011
Posts: 41

Original Poster
Rep: Reputation: 2
Already 24 views and no answer... Is my problem THAT unusual or isn't it clear enough ?

thanks for your answers :-)
 
Old 04-20-2011, 07:11 AM   #3
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
can you show us how you configure your log rotate?
 
Old 04-20-2011, 07:23 AM   #4
mgai7755
Member
 
Registered: Apr 2011
Posts: 41

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by brownie_cookie View Post
can you show us how you configure your log rotate?
Certainly :

cat /etc/logrotate.conf -->

Code:
# 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

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

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here
/etc/openvpn/openvpn.log {
	daily
	rotate 0
}

FYI : ls -lai /var/log --sort=t

Code:
total 43496
695048 -rw-r-----  1 root        adm     9781490 avr 20 13:20 debug.1
695027 -rw-r-----  1 root        adm    12762042 avr 20 13:20 syslog.1
695043 -rw-r-----  1 root        adm      658104 avr 20 13:20 auth.log.1
695223 -rw-r--r--  1 root        root     300684 avr 20 13:20 cron.log.1
695130 -rw-r-----  1 root        adm     1429357 avr 20 13:16 mail.info.1
695187 -rw-r-----  1 root        adm     1429357 avr 20 13:16 mail.log.1
695017 -rw-rw-r--  1 root        utmp    2920584 avr 20 13:12 lastlog
695045 -rw-rw-r--  1 root        utmp       1536 avr 20 13:12 wtmp
695011 -rw-r-----  1 root        adm     1174493 avr 20 13:09 daemon.log.1
694965 drwxr-xr-x 13 root        root       4096 avr 20 10:47 .
695069 -rw-rw----  1 root        utmp          0 avr 20 10:47 btmp
711804 drwxr-xr-x  2 root        root      12288 avr 20 10:47 zarafa
694987 -rw-r-----  1 root        adm           0 avr 20 10:47 dpkg.log
695387 -rw-r-----  1 mysql       adm           0 avr 20 10:47 mysql.log
712534 drwxr-x---  2 root        adm        4096 avr 20 10:47 apache2
695046 drwxr-xr-x  2 root        root       4096 avr 20 10:47 apt
  2631 drwxr-xr-x  2 clamav      clamav     4096 avr 20 10:47 clamav
695128 -rw-r--r--  1 root        root         14 avr 20 10:46 auth.log.1.offset
695101 -rw-r--r--  1 root        root          9 avr 20 10:45 auth.log.offset
695084 -rw-r-----  1 root        adm       95769 avr 20 10:20 dpkg.log.1
695474 -rw-r--r--  1 root        root     320064 avr 20 10:20 faillog
695068 -rw-rw-r--  1 root        utmp      56448 avr 20 09:59 wtmp.1
695437 -rw-r-----  1 mysql       adm          20 avr 20 00:00 mysql.log.1.gz
695172 -rw-r-----  1 mysql       adm          20 avr 19 00:00 mysql.log.2.gz
695239 -rw-r-----  1 mysql       adm          20 avr 18 00:00 mysql.log.3.gz
695367 -rw-r-----  1 mysql       adm          20 avr 17 00:00 mysql.log.4.gz
695193 -rw-r-----  1 mysql       adm          20 avr 16 00:00 mysql.log.5.gz
695190 -rw-r-----  1 mysql       adm          20 avr 15 00:00 mysql.log.6.gz
695119 -rw-r-----  1 mysql       adm          20 avr 14 00:00 mysql.log.7.gz
695183 -rw-r-----  1 root        adm           0 avr 13 00:00 debug
695191 -rw-r-----  1 root        adm           0 avr 13 00:00 messages
703368 drwxr-x---  3 root        adm        4096 avr 13 00:00 samba
695180 -rw-r-----  1 root        adm           0 avr 13 00:00 auth.log
695198 -rw-r--r--  1 root        root          0 avr 13 00:00 cron.log
695041 -rw-r-----  1 root        adm           0 avr 13 00:00 daemon.log
695158 -rw-r-----  1 root        adm           0 avr 13 00:00 kern.log
695203 -rw-r-----  1 root        adm           0 avr 13 00:00 mail.err
694997 -rw-r-----  1 root        adm           0 avr 13 00:00 mail.info
695143 -rw-r-----  1 root        adm           0 avr 13 00:00 mail.log
695054 -rw-r-----  1 root        adm           0 avr 13 00:00 mail.warn
695178 -rw-r-----  1 root        adm           0 avr 13 00:00 user.log
695006 -rw-r-----  1 root        adm           0 avr 13 00:00 syslog
703850 drwxr-xr-x  2 root        root       4096 avr 13 00:00 cups
695148 -rw-r-----  1 root        adm       18787 avr 12 20:21 mail.warn.1
695115 -rw-r-----  1 root        adm        2720 avr 12 20:21 mail.err.1
695032 -rw-r-----  1 root        adm      127546 avr 12 20:20 kern.log.1
695051 -rw-r-----  1 root        adm       74666 avr 12 20:20 messages.1
695349 -rw-r--r--  1 root        root       2005 avr 12 19:19 apcupsd.events
695209 -rw-r-----  1 root        adm         380 avr 12 19:19 user.log.1
694991 -rw-r-----  1 root        adm       41871 avr 12 19:19 dmesg
694977 -rw-r-----  1 root        adm       41890 avr 12 19:02 dmesg.0
695247 -rw-r-----  1 root        adm       11315 avr 12 18:50 kern.log.2.gz
695353 -rw-r-----  1 root        adm        8639 avr 12 18:50 messages.2.gz
695061 -rw-r-----  1 root        adm     1040841 avr 12 18:50 syslog.2.gz
695237 -rw-r-----  1 root        adm      156122 avr 12 18:50 daemon.log.2.gz
695348 -rw-r-----  1 root        adm      314629 avr 12 18:50 debug.2.gz
695250 -rw-r-----  1 root        adm       55689 avr 12 18:50 auth.log.2.gz
695346 -rw-r--r--  1 root        root      33189 avr 12 18:50 cron.log.2.gz
695121 -rw-r-----  1 root        adm      243982 avr 12 18:48 mail.info.2.gz
695206 -rw-r-----  1 root        adm      243982 avr 12 18:48 mail.log.2.gz
695252 -rw-r-----  1 root        adm         237 avr 12 18:48 user.log.2.gz
695417 -rw-r-----  1 mysql       adm           0 avr 12 18:32 mysql.err
695146 -rw-r-----  1 root        adm         155 avr 11 23:42 mail.err.2.gz
695129 -rw-r-----  1 root        adm         388 avr 11 23:42 mail.warn.2.gz
695080 -rw-r-----  1 root        adm        9538 avr  1 08:56 dmesg.1.gz
695215 -rw-r-----  1 root        adm      200849 avr  1 08:45 auth.log.3.gz
695226 -rw-r-----  1 root        adm     2179107 avr  1 08:45 debug.3.gz
695120 -rw-r-----  1 root        adm     6615194 avr  1 08:45 syslog.3.gz
695210 -rw-r-----  1 root        adm      428192 avr  1 08:45 daemon.log.3.gz
695177 -rw-r-----  1 root        adm     2219981 avr  1 08:43 mail.info.3.gz
695205 -rw-r-----  1 root        adm     2219981 avr  1 08:43 mail.log.3.gz
695197 -rw-r-----  1 root        adm       95392 avr  1 08:43 mail.warn.3.gz
695229 -rw-r-----  1 root        adm        1613 avr  1 08:42 messages.3.gz
695217 -rw-r-----  1 root        adm         229 avr  1 08:42 user.log.3.gz
695093 -rw-rw----  1 root        utmp          0 avr  1 00:00 btmp.1
695005 -rw-r-----  1 root        adm         249 mar 31 14:34 dpkg.log.2.gz
695052 -rw-r-----  1 root        adm         437 mar 30 06:57 mail.err.3.gz
695211 -rw-r-----  1 root        adm        1543 mar 25 21:22 kern.log.3.gz
695139 -rw-r-----  1 root        adm         239 déc 15 14:13 dpkg.log.3.gz
686785 drwxr-xr-x 15 root        root       4096 déc 15 11:45 ..
695072 -rw-r-----  1 root        adm       11821 nov 23 16:43 dmesg.2.gz
695112 -rw-r-----  1 root        adm        9099 nov 23 11:57 dmesg.3.gz
695108 -rw-r--r--  1 root        root          0 sep  1  2010 aptitude
694993 -rw-------  1 root        root      34080 aoû  3  2010 openvpn.log
712604 drwxr-s---  2 Debian-exim adm        4096 nov  4  2009 exim4
712697 drwxr-s---  2 mysql       adm        4096 nov  2  2009 mysql
696092 -rw-r--r--  1 root        root        944 fév 11  2009 fontconfig.log
696013 -rw-r--r--  1 root        root          0 sep 30  2008 pycentral.log
695681 -rw-r-----  1 root        adm           0 sep 29  2008 lpr.log
703158 drw-r--r--  2 root        root       4096 sep 29  2008 news
703137 drwxr-xr-x  3 root        root       4096 sep 29  2008 installer
694994 -rw-r-----  1 root        adm          31 sep 29  2008 boot
694975 drwxr-xr-x  2 root        root       4096 sep 29  2008 fsck
 
Old 04-20-2011, 07:33 AM   #5
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
can you also show the output of this command?

Code:
cat /etc/logrotate.d/httpd
 
Old 04-20-2011, 07:38 AM   #6
mgai7755
Member
 
Registered: Apr 2011
Posts: 41

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by brownie_cookie View Post
can you also show the output of this command?
Code:
cat /etc/logrotate.d/httpd
Sure :

Code:
matthieu@server:~$ cat /etc/logrotate.d/httpd
cat: /etc/logrotate.d/httpd: Aucun fichier ou répertoire de ce type (file not found)

matthieu@server~$ ls /etc/logrotate.d 
apache2  aptitude          cups  exim4-base      mysql-server  samba   zarafa-indexer
apt      clamav-freshclam  dpkg  exim4-paniclog  rsyslog       zarafa  zarafa-licensed
I guess you mean apache2 ?

Code:
matthieu@server:/etc/logrotate.d$ cat apache2
/var/log/apache2/*.log {
	weekly
	missingok
	rotate 52
	compress
	delaycompress
	notifempty
	create 640 root adm
	sharedscripts
	postrotate
		if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
			/etc/init.d/apache2 reload > /dev/null
		fi
	endscript
}
Did you noticed that *most* (if not all) of the logfiles are plagued by this problem ? Why would it be related to the settings of a particular service's parameters ?

Last edited by mgai7755; 04-20-2011 at 07:41 AM.
 
Old 04-20-2011, 08:12 AM   #7
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
yes, i've noticed it and i asked it just to be sure...
but i can't seem to help you ... maybe someone else can
 
Old 04-20-2011, 09:08 AM   #8
technodweeb
Member
 
Registered: Dec 2006
Location: South Dakota
Distribution: Red Hat, Ubuntu
Posts: 32

Rep: Reputation: 2
You might want to have a look at syslogd. If that is not running you will not get new log entries. I have never seen that fail to run though. Just a place for you to check.
 
Old 04-20-2011, 03:47 PM   #9
michael.barnes
LQ Newbie
 
Registered: Jan 2007
Location: North Texas
Distribution: SUSE 9, 10; CentOS4,5;Redhat; (K)Ubuntu; Knoppix
Posts: 23

Rep: Reputation: 0
I echo the look at syslogd. Your *.log.1 shows they have content. Look at your naming conventions in your syslogd.conf file. Logrotate looks like it's working just like it is supposed to. It is creating empty log files when it rotates. Perhaps comment the create line out and let syslogd create the new log files and see what happens.
 
Old 04-21-2011, 04:04 AM   #10
mgai7755
Member
 
Registered: Apr 2011
Posts: 41

Original Poster
Rep: Reputation: 2
Ok, thanks everybody for helping. I don't really understand what happened with my logfile system. I checked the rsyslogd.conf file and there wasn't anything unexpected or looking like related to this .log.1 problem.

I solved the case by stopping the rsyslogd process, purging all the log.1 files and restarting. It worked, as far as I can see. Strange.

thanks again to all !

Matthieu
 
Old 04-21-2011, 04:31 AM   #11
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
hopefully it won't happen again !!

Good luck
 
  


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
Log file rotation problem aliweb Linux - Newbie 10 02-02-2011 08:01 AM
How to change Debian log rotation of syslog and daemon.log onmountain Linux - Newbie 2 07-31-2008 03:27 AM
Log Rotation for snort log does not seem to be working CentOS4.5 JasonKretzer Linux - Security 3 06-25-2007 01:25 PM
Log Rotation using Logrotate keysorsoze Linux - General 4 04-13-2007 03:51 PM
Log rotation - NewB nrastogi Linux - Software 1 02-12-2003 11:44 PM


All times are GMT -5. The time now is 06:19 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration