/etc/logrotate.d/squid3 fails to execute sarg-reports

Bug #1414754 reported by Alain Reguera Delgado on 2015-01-26
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
Undecided
Unassigned
squid3 (Ubuntu)
Undecided
Unassigned

Bug Description

In Edubuntu 14.04 LTS, by default, the /etc/logrotate.d/squid3 file is set to rotate the logs in a daily basis but it doesn't specifies that to sarg-reports command.

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

As consequence, sarg-reports fails to do its job and anacron reports the following message:

/etc/cron.daily/logrotate:
SARG - Daily / Weekly / Monthly - Squid proxy usage reports creation tool
Written by Ugo Viti <email address hidden>
Version: 20050202

Usage: /usr/sbin/sarg-reports [OPTIONS]

Allowed options:
    manual, Create Manual report
     today, Create Today report
     daily, Create Daily report
    weekly, Create Weekly report
   monthly, Create Monthly report

A possible solution would be to add the rotation frequency required by sarg-reports command as argument to it.

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

In a Squid3+Sarg configuration, it may be convenient to change the log rotation frequency from daily to monthly, so sarg has more information to work with in a single /var/log/squid3/access.log file.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in logrotate (Ubuntu):
status: New → Confirmed
Todd Bradshaw (snooptodd) wrote :

Sarg installs its own cron.daily,weekly,monthly scripts.
If this line executes then... well it probably wont be what is wanted.
The way it is now, you know it is there and it doesn't cause problems.

Well, I reported the issue because the sarg monthly report was never made in a pristine installation. In the research I found that the access.log file was truncated in a period of time (daily) which is not appropriate for a monthly report, nor even weekly reports. Even though sarg scripts are correctly installed and execute, the problem isn't in them a.f.a I can see, but in the amount of information available in the access.log file. If it is truncated daily, it is not possible for sarg to have enough information to make a monthly report.

Amos Jeffries (yadi) wrote :

This is fixed in the squid package now available in Xenial.

Changed in squid3 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers