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

Bug 216298

Summary: net-misc/tor-0.1.2.19: fails to start after log rotation
Product: Gentoo Linux Reporter: Serge Koksharov <gentoosiast>
Component: New packagesAssignee: Gustavo Felisberto (RETIRED) <humpback>
Status: RESOLVED FIXED    
Severity: normal CC: fauli
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Serge Koksharov 2008-04-05 09:10:51 UTC
After tor log file has been rotated by logrotate utility, tor fails to start.

Reproducible: Always

Steps to Reproduce:
1. Start tor daemon
2. Wait until log file fill ups and log rotation happens
3. See that tor isn't functioning anymore




It happens because logrotate sets default ownership on newly created /var/log/tor.log - root:wheel. tor daemon runs under tor:tor credentials, so it can't open its own log file and fails to start.

Solution: add "create 0640 tor tor" to /etc/logrotate.d/tor.
Comment 1 Christian Faulhammer (RETIRED) gentoo-dev 2008-04-25 09:59:59 UTC
Have you informed upstream about it?

Fixed in -r1 with newly added logrotate USE flag.  Please test and report back.  Thank you for your valuable bug report.
Comment 2 Serge Koksharov 2008-04-29 19:37:17 UTC
Yes, I wrote to upstream.

I tested your changes, it didn't work. You incorrectly placed line 'create 0640 tor tor' inside construction postrotate/endscript. Inside this construction only shell commands are allowed, they will be run after the logfile is rotated, so I receive following output:

sh: line 2: create: command not found
error: error running shared postrotate script for /var/log/tor/*.log

You must put this line before postrotate/endscript construction. I reopened the bug.
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2008-04-29 20:10:35 UTC
(In reply to comment #2)
> Yes, I wrote to upstream.

 Any answer yet?
 
> I tested your changes, it didn't work. You incorrectly placed line 'create 0640
> tor tor' inside construction postrotate/endscript. Inside this construction
> only shell commands are allowed, they will be run after the logfile is rotated,
> so I receive following output:
> 
> sh: line 2: create: command not found
> error: error running shared postrotate script for /var/log/tor/*.log
> 
> You must put this line before postrotate/endscript construction. I reopened the
> bug.

 Ok, I was flying blindly here, so thanks for the test.  I had a look at some documentation and thought place was sensible here.  Should be fixed now in -r2.
Comment 4 Serge Koksharov 2008-04-30 08:57:34 UTC
> Any answer yet?
Not yet. Here you can track their progress: https://bugs.torproject.org/flyspray/index.php?do=details&id=676

> Should be fixed now in -r2.
Yes, now all works fine.