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

Bug 281439

Summary: net-misc/tor-0.2.1.19: logrotate file refers to _tor user and group
Product: Gentoo Linux Reporter: Martin von Gagern <Martin.vGagern>
Component: Current packagesAssignee: Christian Faulhammer (RETIRED) <fauli>
Status: RESOLVED FIXED    
Severity: normal CC: humpback
Priority: High    
Version: 2008.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: tor-0.2.1.19-logrotate.patch
ebuild changes

Description Martin von Gagern 2009-08-14 08:47:29 UTC
I get messages from my logrotate cron job:

error: tor:9 unknown user '_tor'
error: found error in /var/log/tor/*.log , skipping

The cause are these lines in my /etc/logrotate.d/tor from net-misc/tor-0.2.1.19:

        # you may need to change the username/groupname below
        create 0640 _tor _tor
        create 0640 tor tor
        sharedscripts

It seems that the _tor lines come from upstream. According to the ChangeLog, they were a minor bugfix first included in 0.2.1.3-alpha and aiming at https://bugs.torproject.org/flyspray/index.php?do=details&id=676 which seems to be in response to our own bug #216298.

The tor lines on the other hand are added to the file in the src_install phase using some really massively ugly sed script, probably in response to bug #216298 as well. So the issue was fixed twice, once upstream with upstream names, and then at the distro level with our names.

I suggest dropping that sed script and replacing it with some proper patch, preferrably in src_preprare. Such a patch could be combined with the change from tor-0.2.0.30-logrotate.patch from bug #233612. A patch has the benefit over a sed script that epatch complain if it doesn't apply cleanly. It is also much more readable. I'll attach a suitable patch.
Comment 1 Martin von Gagern 2009-08-14 09:09:07 UTC
Created attachment 201210 [details, diff]
tor-0.2.1.19-logrotate.patch

This patch replaces both tor-0.2.0.30-logrotate.patch and the sed script in src_install.
By the way: the old logrotate patch originally came from bug #178975 and was only updated in bug #233612.
My patch contains a header with references to the relevant reports.
Comment 2 Martin von Gagern 2009-08-14 09:12:44 UTC
Created attachment 201212 [details, diff]
ebuild changes

And this is a patch of the required changes to the ebuild, in order to change the used patch file and drop the sed script.
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2009-08-17 19:42:11 UTC
Thanks for your support, that makes bug handling really easy.  Fixed.