Bug 290941 - www/squid: Add periodic script to rotate log files each week
Summary: www/squid: Add periodic script to rotate log files each week
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-11 05:45 UTC by Yasuhiro Kimura
Modified: 2025-11-11 13:44 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (timp87)


Attachments
Patch file (2.57 KB, patch)
2025-11-11 05:45 UTC, Yasuhiro Kimura
no flags Details | Diff
Updated patch file (2.57 KB, patch)
2025-11-11 05:54 UTC, Yasuhiro Kimura
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro Kimura freebsd_committer freebsd_triage 2025-11-11 05:45:57 UTC
Created attachment 265318 [details]
Patch file

Add periodic script to rotate log files each week.
Comment 1 Yasuhiro Kimura freebsd_committer freebsd_triage 2025-11-11 05:54:40 UTC
Created attachment 265319 [details]
Updated patch file

Merge 2 SUB_FILESs in Makefile.
Comment 2 Marek Zarychta 2025-11-11 06:04:37 UTC
Will it not interfere with the standard log rotation method? Squid is in ports for very long time, and people who are using it are already rocating logs in their own way.

# grep squid /etc/newsyslog.conf
/var/log/squid/access.log squid:wheel	640  54   *	$W1D0  XC  /var/run/squid/squid.pid
Comment 3 Yasuhiro Kimura freebsd_committer freebsd_triage 2025-11-11 06:19:49 UTC
(In reply to Marek Zarychta from comment #2)

It is disabled by default and user who want to use it need to enable it explicitly.
Comment 4 Marek Zarychta 2025-11-11 06:26:03 UTC
(In reply to Yasuhiro Kimura from comment #3)
Yes, but why not use standard method and/newsyslog.conf.d files, like other ports do, for example net-mgmt/net-snmp or sysutils/nut ?
Is squid able to keep the track of number of the files rotated this way and compress them ?
Comment 5 Yasuhiro Kimura freebsd_committer freebsd_triage 2025-11-11 06:51:28 UTC
(In reply to Marek Zarychta from comment #4)

Squid provides multiple types of log file. And IIUC squid doesn't provide way to rotate only one type of log file. On the other hand newsyslog check single log file and tries to rotate it. As a result they don't work well with each other.

You may say periodic script doesn't work so well either. But I don't think it bad idea to provide user option to choose. It is maintainer who decides whether my patch is accepted, and when it is accepted then it is each user who decides whether he use it or not.
Comment 6 Marek Zarychta 2025-11-11 07:22:39 UTC
(In reply to Yasuhiro Kimura from comment #5)
>On the other hand newsyslog check single log file and tries to rotate it.
There can be more than one entry in newsyslog.conf(5) file.

>It is maintainer who decides whether my patch is accepted, and when it is accepted then it is each user who decides whether he use it or not.
Yes, it's always the maintainer who approves the change or not.
Thank you for the contribution.
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-11 13:44:18 UTC
Better create patch against 7.3. Also you can get bug#290630 - I can't find time yet…