Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 483672

Summary: =net-nntp/sabnzbd-0.7.14 - Logrotate config conflicts with built-in log rotation.
Product: Gentoo Linux Reporter: Mike Nerone <mike>
Component: Current packagesAssignee: Justin Bronder (RETIRED) <jsbronder>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Mike Nerone 2013-09-05 08:35:14 UTC
The build installs a standard log rotation config in /etc/logrotate.d, but SABnzbd already includes this feature, and it is enabled by default. This results in a mix of different-named rotating logs in the log dir ("sabnzbd.log-YYYYMMDD.gz" from logrotate and "sabnzbd.log.N" from the built in one) as these two rotation mechanisms keep stepping on eachother.

This feature can be verified by looking at /usr/share/sabnzbd/SABnzbd.py. Search for RotatingFileHandler. Any Python dev will immediately recognize usage of Python's standard logging module including its log rotation mechanism. Also note that *this* log rotation is based on file size. If you're a very light user of SABnzbd, the log file may never hit the trigger size (default 5242880 bytes) before logrotate rotates it, so you would never see the mixed filenames (indeed, this is why I'd never noticed the problem before).

One or the other needs to be turned off. I'd suggest simply ditching the logrotate.d file, as the built-in handler has the efficiency of not having to restart SABnzbd. Also, the built-in one can't, in fact, be disabled (but you could effectively do it by setting max_log_size to something really huge in sabnzbd.ini).
Comment 1 Justin Bronder (RETIRED) gentoo-dev 2013-10-08 23:20:36 UTC
+*sabnzbd-0.7.16 (08 Oct 2013)
+
+  08 Oct 2013; Justin Bronder <jsbronder@gentoo.org> -sabnzbd-0.7.13-r2.ebuild,
+  -sabnzbd-0.7.14.ebuild, +sabnzbd-0.7.16.ebuild, +files/par2cmdline.patch,
+  files/sabnzbd.initd, -files/sabnzbd.logrotate:
+  Version bump and remove old (#484226). Fix initd script thanks to eponymous
+  (#483786). Remove logrotate (#483672). Fix issues with stable version of
+  par2cmdline thanks to dcb (#480302).