impstats file is not handled with the normal HUP processing

but if you have

*.* /var/log/foofile

and do
mv foofile $foofile.old
killall -HUP rsyslogd

the next time a message is processed that belongs in foofile, it will get created.

I do this all the time, my log rotate file is:

#!/bin/sh
#

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

umask 022
year=`date +%Y`
month=`date +%m`
day=`date +%d`
fdate=`date +%Y%m%d.%H%M`
logroot=/var/log
logroll=$logroot/oldlogs

cd $logroot
mkdir -p $logroll/$year/$month/$day >/dev/null 2>/dev/null
# note: without the -- a file named -messages will be interpreted as flags to ls
ls -- *-messages messages-*[A-Za-z] messages|grep -v -e -tagged- |grep -v ".xz$" | while read file; do
  mv -- "$file" "$file.$fdate"
done
date >> /var/log/logrotate.log
#turn debugging logs on
pkill -USR1 rsyslogd
pkill -HUP rsyslogd
#pkill -USR2 sec
sleep 5
#turn debugging logs off
pkill -USR1 rsyslogd
#nice xz -9 -T 4 `ls -Sr *.$fdate`
while ls -- *.$fdate |grep -v -e -tagged-
do
for file in `du -k -- *.$fdate |grep -v -e -tagged- |sort -n |cut -f 2 |head --lines=8`
  do
    nice xz -9 -e -- "$file" &
  done
  wait
done
#catch any files that have spaces in the name and the prior section didn't catch
#nice xz -9 -e -- *.$fdate 2>&1 >/dev/null
mv -- `ls *.$fdate.xz |grep -v -e -tagged- ` $logroll/$year/$month/$day


On Thu, 30 Jul 2015, Randall Diffenderfer wrote:

Date: Thu, 30 Jul 2015 23:04:20 +0000
From: Randall Diffenderfer <[email protected]>
Reply-To: rsyslog-users <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [rsyslog] expected behavior on HUP

i see that for a target such as

*.*             /var/log/foofile

if i "rotate" /var/log/foofile out of the way, and then do a HUP on
rsyslogd, i do get new data going to a new /var/log/foofile

however, if i have a pstats "direct" target such as

module(load="impstats" log.syslog="off" log.file="/var/log/statsfile")

if i "rotate" /var/log/statsfile out of the way, and then do a HUP on
rsyslogd, i do *not* get new data going to a new /var/log/statsfile, but
still appending to the "old" file.

is this expected behavior?

for the record:

rsyslogd 8.10.0, compiled with:
        PLATFORM:                               x86_64-redhat-linux-gnu
        PLATFORM (lsb_release -d):
        FEATURE_REGEXP:                         Yes
        GSSAPI Kerberos 5 support:              No
        FEATURE_DEBUG (debug build, slow code): No
        32bit Atomic operations supported:      Yes
        64bit Atomic operations supported:      Yes
        memory allocator:                       system default
        Runtime Instrumentation (slow code):    No
        uuid support:                           Yes
        Number of Bits in RainerScript integers: 64

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to