View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 3 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Logrotate issue with R6
PostPosted: Tue Aug 04, 2009 12:54 am 
Offline
Joined: Wed Feb 07, 2007 11:28 pm
Posts: 19
Location: Phx, AZ
I have noticed in R6 my log files are not rotating properly. When the logs rotate, the logs continue to go into the new back version "logfile.log.1" and the current log file does not update. I noticed this after a ls -lrt of the /var/log area. All the current logfiles were zero in size. I then did a tail -f of everything.log and nothing was updating. A tail -f of everything.log.1 showed that this file was being written to.

Code:
ls -lrt /var/log
-rw-r----- 1 root   log          0 2009-08-02 00:02 user.log
-rw-r----- 1 root   log          0 2009-08-02 00:02 syslog.log
-rw-r----- 1 root   log          0 2009-08-02 00:02 messages.log
-rw-r--r-- 1 root   root         0 2009-08-02 00:02 lircd
drwxr-xr-x 2 http   http      4096 2009-08-02 00:02 lighttpd
-rw-r----- 1 root   log          0 2009-08-02 00:02 kernel.log
-rw-r----- 1 root   log          0 2009-08-02 00:02 everything.log
-rw-r----- 1 root   log          0 2009-08-02 00:02 errors.log
-rw-r----- 1 root   log          0 2009-08-02 00:02 daemon.log
-rw-r----- 1 root   log          0 2009-08-02 00:02 auth.log
-rw-r----- 1 root   log          0 2009-08-02 00:02 acpid.log
-rw-r----- 1 root   log     281295 2009-08-02 22:09 kernel.log.1
drwxr-xr-x 2 mythtv root      4096 2009-08-03 00:02 mythtv
-rw-r----- 1 root   log       5057 2009-08-03 00:02 user.log.1
-rw-r--r-- 1 root   root     46898 2009-08-03 20:51 Xorg.0.log
-rw------- 1 root   root     16512 2009-08-03 21:35 btmp
-rw-r--r-- 1 root   root    293168 2009-08-03 21:35 lastlog
-rw-rw-r-- 1 root   root      3072 2009-08-03 21:47 wtmp
-rw-r----- 1 root   log      18038 2009-08-03 22:38 daemon.log.1
-rw-r--r-- 1 root   root      1715 2009-08-03 22:41 lircd.1
-rw-r----- 1 root   log       8656 2009-08-03 22:41 auth.log.1
-rw-r----- 1 root   log     714461 2009-08-03 22:41 acpid.log.1
-rw-r----- 1 root   log     205741 2009-08-03 22:45 errors.log.1
-rw-r----- 1 root   log    1209431 2009-08-03 22:47 messages.log.1
-rw-r----- 1 root   log    1442247 2009-08-03 22:47 everything.log.1


I have changed nothing with the logrotate.conf file. It is from the R6 iso install. This is what is in the file:
Code:
[root@mythtv ~]# 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

# Logs are moved into directory for rotation
# olddir /var/log/archive

# Ignore pacman saved files
tabooext + .pacorig .pacnew .pacsave

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

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


If I reboot the system, it starts logging to the correct log files.
I wanted to know if anyone else has seen this and any solutions for a fix.

_________________
R6.01.00
ASUS M3A78
AMD Athlon 64 X2 7750 Kuma 2.7GHz
2GB DDR2 1066
2 Seagate's (.75 & 1.5) 2.25Tb
GIGABYTE GV-NX84S512HP 8400GS 512MB
PVR-150,PVR-250, 2X HVR-1250
Silverstone GD01B-MXR with Imon


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 01, 2009 9:26 pm 
Offline
Joined: Wed Jan 18, 2006 8:36 pm
Posts: 177
The problem appears to be in /etc/logrotate.d/syslog-ng. The script assumes the program is running as a standard daemon, but it's not. Change this line:
Code:
/bin/kill -HUP `cat /var/run/syslog-ng.pid 2>/dev/null`  2> /dev/null || true

to
Code:
/usr/bin/killall -HUP -q syslog-ng


Next is probably the backend. Add:
Code:
   postrotate
       /usr/bin/killall -HUP -q mythbackend
   endscript

to /etc/logrotate.d/mythbackend.lr

I believe this leaves lirc and the same trick appears to work. My lirc appears to have no rotation set-up, so add this to /etc/logrotate.d/lirc
Code:
   postrotate
       /usr/bin/killall -HUP -q lircd
   endscript


You can run logrotate -d /etc/logrotate.conf to make sure you didn't badly damage logrotate.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 07, 2010 1:05 am 
Offline
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location: Perth, Australia
on an unrelated note, this post saved my day... I had a dodgy DVBt card fill up my root partition, and cause my Linhes to barf. Without thinking, I cleared the /var/log directory, and rebooted, all back to normal...

Problem is that webmin, mythweb and monitorix all didnt work...

Turns out that for webmin and lighttp, they need the correct /var/log folders, with the correct ownership. Otherwise they barf.

The first post in this gave me the http/http owner/group information i needed!

Thanks

NAthan

_________________
LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu