Project

General

Profile

Actions

Bug #5547

closed

sarg log rotate is broken

Added by Nicolas Marot about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
11/27/2015
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:
All

Description

when rotate dansguardian logs (but should applied for other proxy, since it is a function), sarg does a mistake on filename
access.log becomes access.log.0 and becomes access.log1 and then rotation is broken

this is in /usr/local/pkg/sarg.inc :

line 91 //rename("{$log_file}.{$i}", "{$log_file}" . ($i + 1));
line 92 rename("{$log_file}.{$i}", "{$log_file}." . ($i + 1));

there is also something wrong with 10th file, which is not deleted as expected :

line 85 // remove .10 rotate log file
line 86 unlink_if_exists("{$log_file}.10");

Finally, when access.log is rotated, file access right is changed from 644 to 666
I don't know where to fix this

Actions #1

Updated by Kill Bill about 9 years ago

This "feature" will go to /dev/null as soon as I get to it. Stop using this. It screws permissions and is an absolutely horrible idea. There's log rotation in Squid, no need for this in other packages.

Actions #2

Updated by Nicolas Marot about 9 years ago

Thanks for your answer !
Yes, for sure, it is uggly feature.
Since I use dansguardian, I had to manually activate log rotation for dansguardian (thanks to forum).
It is planned to implement dansguardian log rotation by default ?

Actions #3

Updated by Kill Bill about 9 years ago

In DG, I guess not really, it's dead. There's a pending pull request for E2Guardian on GitHub, so, perhaps you could do a PR for that there to get the log rotation added (haven't really checked whether it's there or not, the code is huge.)

https://github.com/pfsense/pfsense-packages/pull/866
https://github.com/marcelloc/pfsense-packages/tree/e2guardian_20150420

Other than that - yeah this code and the service restarts seriously need to get booted from Sarg. Packages steping on each other's foot is really bad idea, also tends to get out of sync quickly, causing even more breakage.

Actions #5

Updated by Kill Bill about 9 years ago

Fixed in 0.6.9 by removing the nasty "feature". (You might want to re-save your scheduled reports to get rid of lingering configuration junk, though it won't harm anything, simply no-op cruft in config.xml.)

Actions #6

Updated by Chris Buechler about 9 years ago

  • Status changed from New to Resolved
  • Affected Version deleted (2.2.5)

thanks

Actions

Also available in: Atom PDF