← Back to team overview

touch-packages team mailing list archive

[Bug 590342] Re: logrotate rotates logs before analysers can parse them

 

It is necessary to change the /etc/logrotate.d/squid3 file to rotate
from daily to monthly so the /var/log/squid3/access.log file be present
for a longer period of time and sarg can have more information to work
with. In Ubuntu 14.04 LTS, /etc/logrotate.d/squid3 looks like the
following:

/var/log/squid3/*.log {
        monthly
        compress
        delaycompress
        rotate 2
        missingok
        nocreate
        sharedscripts
        prerotate
                test ! -x /usr/sbin/sarg-reports || /usr/sbin/sarg-reports monthly
        endscript
        postrotate
                test ! -e /var/run/squid3.pid || test ! -x /usr/sbin/squid3 || /usr/sbin/squid3 -k rotate
        endscript
}

Note here that the rotation frequency (monthly in this case) must be
provided as argument to sarg-reports command (it by default isn't and
generates an issue) so logrotate and sarg be both consequent one
another.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to logrotate in Ubuntu.
https://bugs.launchpad.net/bugs/590342

Title:
  logrotate rotates logs before analysers can parse them

Status in logrotate package in Ubuntu:
  New

Bug description:
  Binary package hint: logrotate

  Since logrotate is called from anacron via the cron.daily directory,
  anything that is also located in that directory and has a name after
  "logrotate", won't be able to access the logs rotated by logrotate.

  I want to generate reports about my local squid3 installation and the
  analysers I use are "srg" and "sarg". Since they are executed after
  logrotate, the squid3 log will be empty when they run, making the
  whole effort an exercise in futility and annoying me with emails such
  as this:

  --------------------------------
  /etc/cron.daily/sarg:
  SARG: unexpected end of file encountered in /var/log/squid3/access.log
  SARG: Keine Datensaetze gefunden
  /etc/cron.daily/srg:
  No logfile lines found to process!
  run-parts: /etc/cron.daily/srg exited with return code 1
  --------------------------------

  To remedy this, /etc/cron.daily/logrotate should be run after all
  other files run by anacron.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: logrotate 3.7.8-4ubuntu2
  ProcVersionSignature: Ubuntu 2.6.32-22.35-generic 2.6.32.11+drm33.2
  Uname: Linux 2.6.32-22-generic i686
  Architecture: i386
  Date: Sun Jun  6 10:37:50 2010
  EcryptfsInUse: Yes
  ProcEnviron:
   LANGUAGE=
   PATH=(custom, user)
   LANG=de_DE.UTF-8
   SHELL=/bin/bash
  SourcePackage: logrotate

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/590342/+subscriptions