Here's a new sysklogd ebuild that does not automatically enable the Debian cron log rotation scripts if you are using logrotate. sysklogd has since maybe version 1.5 was released, shipped its own very simplistic log rotation cron jobs. sysklogd-1.5.ebuild installs them in /etc/cron.daily/ and /etc/cron.weekly/ automatically (they are not even flagged as config files and thus subject to review by etc-update). logrotate provides more options and a cleaner config file than editing these scripts. If one has both installed, they fight over syslog log files. So, I've created an updated sysklogd .ebuild that respects the logrotate USE flag. It puts the rotation scripts not directly in /etc/cron.{daily,weekly} but in /usr/sbin, and then creates symlinks into /etc/cron.{daily,weekly} only if the logrotate USE flag is not enabled. Reproducible: Always Steps to Reproduce: 1. Install logrotate. 2. Install sysklogd. 3. Remove sysklogd's cron jobs because you prefer logrotate. 4. Upgrade sysklogd (some day). 5. Cry because those cron jobs are back and you did not want them, and now you cannot find your nicely moved-to-old/, named-with-date-extension, compressed logs, and the new logfiles are not created your preferred ownership, etc.
Created attachment 235649 [details] New sysklogd ebuild that respects the logrotate USE flag
I should add that my /usr/sbin/, dosym handwaving might well not be the right way to fix this. For instance, one could argue that the log rotation scripts derived from Debian are indeed config files, so /usr/sbin/ isn't an appropriate place for them--if you do use them, you may want to change them, in which case they should be covered by etc-update.
Comment on attachment 235649 [details] New sysklogd ebuild that respects the logrotate USE flag post a diff, not a full file. and yes, these should not be installed into /usr/sbin. you can already disable these files on your system by adding 'exit 0' to the top and etc-update should allow you to merge things. does this not work for you ?
and bug 198901 ?
this isnt really the same as that bug because in this case, we arent installing config files for the logrotate package. we're enabling the built-in logrotate functionality of sysklogd (albeit, via cron.d files in /etc/).
> post a diff, not a full file. Thanks, will do in the future. For some reason I did not think etc-update was doing the right thing wrt these. Perhaps I had only tried chmod -x'ing them to disable them, but not tried adding exit's at the top (in which case they are silently +x'ed when next emerging the package). I was wrong in my original statement: sysklogd does not "[ship] its own very simplistic log rotation cron jobs". Those scripts are not part of the sysklogd distribution. The ebuild adds them by importing a Debian patch set. wrt doing away with the logrotate use flag, note that the "well that seems OK" exception was for squid, which uses logrotate in exactly the manner I want sysklogd to do (except I was trying to preserve copies of those files even if logrotate was used--I'd be happier to just not install them at all, like squid). To me, logrotate and these bundled scripts (not native to sysklogd, remember) provide duplicate functionality, but logrotate does it better (more features, cleaner to configure). I want a knob to be able to specify which I prefer, and to only have to turn it once. People may choose not to use logrotate, fine and good. But if you do choose to use logrotate, what use are the scripts that are added to sysklogd, and which are turned on unconditionally? Most packages that PROVIDE virtual/logger do only that, log, not rotate/manage logfiles. For example: - syslog-ng: no log-management of any kind - rsyslog: no builtin log-management, except drops a logrotate.d/ file - metalog: _does_ do logfile-management natively, part of its core functionality (manage files by size or age) - syslogread: no log-management of any kind Perhaps the right way to do this is not to USE logrotate, but to create virtual/logrotation or something, which can be provided by logrotate or some other package (including somebody's home-grown scripts if they prefer) which tells the packages that care, "don't worry about log rotation, I've got it covered."
i dont use sysklogd, so i'm not really familiar with the functionality it provides. does it install logrotate files that can be used with app-admin/logrotate already ?
Created attachment 328162 [details, diff] Patch to add USE=logrotate flag to sysklogd-1.5-r2.ebuild
Created attachment 328164 [details] /etc/logrotate.d/ config file for sysklogd's default configuration
Sorry for not getting back to this for so long. sysklogd doesn't currently include a logrotate conf file. I've attached one that matches the files created by the syslog.conf file that sysklogd-1.5-r2 installs by default, and a patch to sysklogd-1.5-r2.ebuild that deploys this logrotate file if USE=logrotate, or otherwise uses the currently bundled simple cron scripts. * This version doesn't install the bundled script at all if USE=logrotate. If they should go in /usr/sbin/ (or /usr/share/doc/sysklogd-*) let me know, I'll rework the patch.
Ping... any thoughts on this / chance it can get included, and sysklogd 1.5 marked stable? (Is there a more appropriate way to bump an existing bug than to add a new comment to it?)
(In reply to comment #11) i know nothing about sysklogd, nor care about it. your patches look sane though, let's toss them in and see what goes boom.
should be all set now in the tree; thanks for the report! Commit message: Add support for USE=logrotate. http://sources.gentoo.org/app-admin/sysklogd/files/sysklogd.logrotate?rev=1.1 http://sources.gentoo.org/app-admin/sysklogd/metadata.xml?r1=1.1&r2=1.2 http://sources.gentoo.org/app-admin/sysklogd/sysklogd-1.5-r3.ebuild?rev=1.1