Bug #2869

squidGuard.log not rotated

Added by Filippo Carletti about 5 years ago. Updated about 5 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-squidguard
Target version:v6.5
Security class: Resolution:
Affected version:v6.5-final NEEDINFO:No

Description

# cat /etc/logrotate.d/squidGuard 
/var/log/squid/squidGuard.log {
    weekly
    compress
    notifempty
    missingok
}
# rpm -qf /etc/logrotate.d/squidGuard 
squidGuard-1.4-9.el6.x86_64
# grep logdir /etc/squid/squidGuard.conf 
logdir /var/log/squidGuard
As you can see, squidGuard package rotates standard log in /var/log/squid, but we log into /var/log/squidGuard.
Two issues arise:
  1. rotate "right" squidGuard.log
  2. rotate urlfilter.log

Associated revisions

Revision 0142b815
Added by Giacomo Sanchietti about 5 years ago

Log rotation: create new template for logrotate. Refs #2869

History

#1 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20
  • Affected version set to v6.5-final

#2 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 20 to 30

#3 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from ON_DEV to TRIAGED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 30 to 20

The squidGuard package contains both logs:

rpm -qlv squidGuard | grep log
-rw-r--r--    1 root    root                       87 Jun 27  2012 /etc/logrotate.d/squidGuard
lrwxrwxrwx    1 root    root                       28 Jun 27  2012 /var/log/squid/squidGuard.log -> ../squidGuard/squidGuard.log
drwxr-xr-x    2 root    root                        0 Jun 27  2012 /var/log/squidGuard

But /var/log/squid/squidGuard.log is a link. The link is lost after the logrotate.

I see a couple of solutions.

Solution 1:
  • patch squidGuard package to remove the link
  • change squidGuard configuration to log in /var/log/squid
Solution 2:
  • change the logrotate configuration to rotate files inside /var/log/squidGuard directory. Should we create a template or patch squidGuard package?

#4 Updated by Filippo Carletti about 5 years ago

I'd report the problem upstream and fork the package.

#5 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 20 to 30

#6 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

SquidGuard package is from EPEL repository.

I add a new template and reported the issue upstream: https://bugzilla.redhat.com/show_bug.cgi?id=1149090

#7 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-squidguard-1.0.4-2.0git0142b815.ns6.noarch.rpm
Test case
  • On a clean machine install nethserver-squidguard
  • Check the link /var/log/squid/squidGuard.log exists
  • Create a fake log file:
    echo "AAA" > /var/log/squidGuard/squidGuard.log
    
  • Force log rotation:
    logrotate -f /etc/logrotate.conf
    
  • Check the link is still in place
  • Check squid and squidGuard log is are rotated

#8 Updated by Davide Principi about 5 years ago

  • Assignee set to Davide Principi

#9 Updated by Davide Principi about 5 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 70 to 90

VERIFIED

NOTE

When squid logs are rotated the /var/log/squid/squidGuard.log symlink is substituted by a regular file.

squidGuard logs are under /var/log/squidGuard.

#10 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Package released in nethserver-updates:
  • nethserver-squidguard-1.0.5-1.ns6.noarch.rpm

Also available in: Atom PDF