|
Bugzilla – Full Text Bug Listing |
| Summary: | Move /etc/logrotate.d/* to /usr/etc/logrotate.d | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE Tumbleweed | Reporter: | Stefan Dirsch <sndirsch> |
| Component: | Basesystem | Assignee: | Stefan Schubert <schubi> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | bjoernv, crrodriguez, david.anes, dmueller, genes1122, paul.pgp-7, pmonrealgonzalez, schubi, suse-beta, toganm |
| Version: | Current | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
Stefan Dirsch
2020-06-24 14:32:22 UTC
Adding maintainers of logrotate to Cc Just for reference, see also the opensuse-factory ML thread: https://lists.opensuse.org/opensuse-factory/2020-06/msg00248.html Pedro, any plans to look into this? Just to make sure, I'm not planning to implement this. I just need it for some of my packages. ;-) Others need it as well for sure .... We were discussing this in the packaging team but I'm not yet sure how to do it, especially with the files in /etc/logrotate.d/*. Lots of packages would need to be adapted with this change. Variant 1 should be applied here. (In reply to Pedro Monreal Gonzalez from comment #4) > We were discussing this in the packaging team but I'm not yet sure how to do > it, especially with the files in /etc/logrotate.d/*. Lots of packages would need to be adapted with this change. So what? I would be happy to adjsut all affected files of my pacckages. > Variant 1 should be applied here. Yes, of course. (In reply to Stefan Dirsch from comment #5) > (In reply to Pedro Monreal Gonzalez from comment #4) > > We were discussing this in the packaging team but I'm not yet sure how to do > > it, especially with the files in /etc/logrotate.d/*. Lots of packages would need to be adapted with this change. > > So what? I would be happy to adjsut all affected files of my pacckages. From [https://build.opensuse.org/package/view_file/Base:System/logrotate/logrotate.default?expand=1], there is this directory where packages write their rotation info: # RPM packages drop log rotation information into this directory include /etc/logrotate.d Also the systemd files, to which .conf file should they point to? ExecStart=/usr/sbin/logrotate /etc/logrotate.conf > > Variant 1 should be applied here. > > Yes, of course. Yeah. That's why Thorsten Kukuk wrote: "Somebody need to rewrite logrotate first. ;-)". So after almost one year there is no progress on any approach :( Yes, I just can't find the time to work on this but patches/fixes are welcome. It seems logrotate now supports /usr/etc/logrotate.d/ using an interesting[tm] solution in logrotate.service.
One confusing thing is that /usr/etc/logrotate.conf only has
include /usr/etc/logrotate.d
but it does NOT have
include /etc/logrotate.d
That missing include /etc/logrotate.d is at least confusing. Is there a specific reason why it isn't in the default config? If not, adding it might prevent confusion for people who read logrotate.conf.
Thanks for finding this ticket, Christian! Let's better reassign this ticket to schubi, since he has implemented that feature - obviously without knowing that such a ticket exists since two years ... This was implemented in logrotate-3.20.1-2.2, but now using /etc/logrotate.d/zypp-history.lr is broken. The file in /etc/logrotate.d is preserved across updates, but I get this journal error message since that update: > journalctl -p err -u logrotate.service Sep 06 00:00:02 Mobile-PC systemd[1]: Failed to start Rotate log files. -- Boot ac535881d63e4741a64e81cbb73e153a -- Sep 07 04:45:13 Mobile-PC systemd[1]: Failed to start Rotate log files. -- Boot 35f3b6fda0984c4cb85d380f76bf607e -- Sep 08 02:48:29 Mobile-PC systemd[1]: Failed to start Rotate log files. -- Boot acb8ef636b604f88bdc345ec5436fd8c -- Sep 09 07:50:22 Mobile-PC systemd[1]: Failed to start Rotate log files. -- Boot 0e96e0a1f82a47668f52ac8b4f4c9625 -- Sep 10 07:25:37 Mobile-PC systemd[1]: Failed to start Rotate log files. and > journalctl -b ac535881d63e4741a64e81cbb73e153a -u logrotate.serviceSep 07 04:45:13 Mobile-PC systemd[1]: Starting Rotate log files... Sep 07 04:45:13 Mobile-PC sh[1185]: error: zypp-history.lr:1 duplicate log entry for /var/log/zypp/hist> Sep 07 04:45:13 Mobile-PC sh[1185]: error: found error in file zypp-history.lr, skipping Sep 07 04:45:13 Mobile-PC systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAI> Sep 07 04:45:13 Mobile-PC systemd[1]: logrotate.service: Failed with result 'exit-code'. Sep 07 04:45:13 Mobile-PC systemd[1]: Failed to start Rotate log files. So this update introduced a problem when the administrator uses files in /etc/logrotate.d to over-ride package config files. Gene (In reply to Gene Snider from comment #12) > Sep 07 04:45:13 Mobile-PC sh[1185]: error: zypp-history.lr:1 duplicate log > entry for /var/log/zypp/hist> > Sep 07 04:45:13 Mobile-PC sh[1185]: error: found error in file > zypp-history.lr, skipping Could you please attach your zypp-history.lr from /etc AND /usr/etc ? (In reply to Stefan Schubert from comment #14) > (In reply to Gene Snider from comment #12) > > Sep 07 04:45:13 Mobile-PC sh[1185]: error: zypp-history.lr:1 duplicate log > > entry for /var/log/zypp/hist> > > Sep 07 04:45:13 Mobile-PC sh[1185]: error: found error in file > > zypp-history.lr, skipping > Could you please attach your zypp-history.lr from /etc AND /usr/etc ? Not needed anymore. I can reproduce this bug. https://build.opensuse.org/request/show/1003701 ------------------------------------------------------------------- Wed Sep 14 11:15:55 UTC 2022 - Stefan Schubert <schubi@suse.com> Ignoring vendor logs settings in /usr/etc/logrotate.d if they have already been defined by the the admin in the /etc/logrotate.d directory (bsc#1173319). ------------------------------------------------------------------- I have also removed the "include" in logrotate.conf because it will be handled in logrotate.service. Thanks for the hints ! :-) Your welcome! Thanks for the fixes. Gene While performing an update to latest version of logrotate in Factory, I found a new feature is implemented: * https://github.com/logrotate/logrotate/pull/473 @Stefan, do you mind to review the patch you introduced[1] (or remove it entirely) from TW by using that feature? I prefer to ask than breaking something that took so long to fix. Thanks. [1] https://build.opensuse.org/package/rdiff/Base:System/logrotate?linkrev=base&rev=103 (In reply to David Anes from comment #18) > While performing an update to latest version of logrotate in Factory, I > found a new feature is implemented: > * https://github.com/logrotate/logrotate/pull/473 > > @Stefan, do you mind to review the patch you introduced[1] (or remove it > entirely) from TW by using that feature? I prefer to ask than breaking > something that took so long to fix. > > Thanks. > > [1] > https://build.opensuse.org/package/rdiff/Base:System/ > logrotate?linkrev=base&rev=103 The question is how LOG_FLAG_IGNOREDUPLICATES is set. If this flag is set when ENABLE_VENDORDIR has also been set then there is a chance to drop the patch because you can manage it in the configure.ac script outside of the code. |