Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1231662
| From | Chris Hofstaedtler <zeha@debian.org> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#1094965: wtmpdb: provides no way to prune rotated logs |
| Date | 2025-02-04 00:00 +0100 |
| Message-ID | <KcdA5-ebPH-1@gated-at.bofh.it> (permalink) |
| References | <KbtdT-dDEI-1@gated-at.bofh.it> <KbtdT-dDEI-1@gated-at.bofh.it> <KcdgJ-ebGo-1@gated-at.bofh.it> <KbtdT-dDEI-1@gated-at.bofh.it> <KcdgJ-ebGo-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* Andrew Bower <andrew@bower.uk> [250203 23:39]: > Control: tags -1 patch > > On Sat, Feb 01, 2025 at 09:24:31PM +0000, Andrew Bower wrote: > > wtmpdb will rotate logs but nothing will prune them (like logrotate would for > > other types of log - unfortunately it doesn't fit in well with the wtmpdb way). > > I have come up with a solution whereby a 'prune' systemd unit is chained > from the 'rotate' service. This calls into a script to prune logs beyond > a configured limit. One can disable the prun unit or edit it to adjust > the parameters. > Any feedback much appreciated! > > https://salsa.debian.org/abower/wtmpdb/-/commit/512fa747f9943e1b8b4e7c169dabc1c67c004313 > (branch 'log-pruning') ISTM this is a lot of new, potentially fragile sh code, possibly with undefined semantics. Indeed shellcheck has a lot of things to say, including: | In prune-logs line 9: | set -o pipefail | ^------^ | SC3040 (warning): In POSIX sh, set option pipefail is undefined. I'm not an expert in sh scripting, but I'd try to make it shellcheck clean. Generally I think whatever Debian ends up shipping should also go upstream. > One nicety of the old wtmp logrotate config is that it wouldn't even > rotate until the log hit 1MB. > > What do we think of that idea? It seems logical - no point in rotating > tiny files! It's a trade off to what should be kept. If you have strict requirements on how many days can be kept, then also small files must be treated. Maybe a find call with -mtime <something> would be enough. Chris
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bug#1094965: wtmpdb: provides no way to prune rotated logs Andrew Bower <andrew@bower.uk> - 2025-02-01 22:30 +0100
Bug#1094965: wtmpdb: provides no way to prune rotated logs Andrew Bower <andrew@bower.uk> - 2025-02-03 23:40 +0100
Bug#1094965: wtmpdb: provides no way to prune rotated logs Chris Hofstaedtler <zeha@debian.org> - 2025-02-04 00:00 +0100
Bug#1094965: wtmpdb: provides no way to prune rotated logs Andrew Bower <andrew@bower.uk> - 2025-02-04 01:40 +0100
Bug#1094965: wtmpdb: provides no way to prune rotated logs Chris Hofstaedtler <zeha@debian.org> - 2025-02-04 10:40 +0100
Bug#1094965: wtmpdb: provides no way to prune rotated logs Andrew Bower <andrew@bower.uk> - 2025-02-04 11:00 +0100
csiph-web