Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191476 - net-misc/tor-0.1.2.16 does not start because logrotate changes permissions on tor.log
Summary: net-misc/tor-0.1.2.16 does not start because logrotate changes permissions on...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High enhancement
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-06 10:05 UTC by Dirk
Modified: 2007-09-06 21:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
The /etc/logrotate.d/tor file with the line from the initial report (tor,191 bytes, text/plain)
2007-09-06 10:08 UTC, Dirk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk 2007-09-06 10:05:55 UTC
Succinct: Someone missed to explicitly set the permissions in /etc/logrotate.d/tor. Sorry if I missed reasons not to do so.

AFAIK the tor installation runs under the additional "tor" UID per default. 
There is a problem, as i override the default creation perm-user-group values in /etc/logrotate.conf, to something other then the tor uid.
It would be good to set the tor.log permission explicitly, in /etc/logrotate.d/tor, otherwise tor doesn't start because it can't read tor.log - possibly.

Adding the following in /etc/logrotate.d/tor solves it:
    create 600 tor tor
Comment 1 Dirk 2007-09-06 10:08:54 UTC
Created attachment 130152 [details]
The /etc/logrotate.d/tor file with the line from the initial report
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-09-06 10:53:15 UTC
(In reply to comment #0)
> There is a problem, as i override the default creation perm-user-group values
> in /etc/logrotate.conf, to something other then the tor uid.

What exactly are you overriding? No such problem here.
Comment 3 Dirk 2007-09-06 17:50:52 UTC
(In reply to comment #2)

 If a file gets rotated, the original logfile is packed and if necessary moved.
Per default logrotate creates the now missing logfile with the same permissions, uid/gid as it had before.
You can adjust all the files the way you like it and let logotate recreate them accordingly.
Alternatively you can enforce a special policy by saying: "All the files which don't have an explicit specification should get <these> perm-uid-gid", so you don't miss one accidently.

You do that by giving a global 'create' directive, within your main logrotate.conf file, outside any curly-block { ... }.

So for example, if you want only root to modify log-files, but let members of a 'audit' group read them you can specify:
    create 640 root audit
Actually, like that, you apply global defaults generally, for all keywords.
This policy does not work, if you run an application as non-root, because they could not read the log after rotating it. 
For these apps you have to override this setting with a create directive especially for the corresponding logfile.
Allegedly, one can restore the default by omitting any of the field in the create directive, which does not work with my version, at least not if i give the create keyword unmated.

Recap: the crucial point is to give a global 'create'-default outside any curly block {} and let the tor.log rotate. Then you'll see.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-09-06 17:55:29 UTC
Yeah, and why are you needlessly creating problems for yourself? :) This will break anything that relies on specific log permissions and installs a logrotate entry, including portage's elog feature  - not just tor. Just that noone is affected until they break it for themselves.
Comment 5 Dirk 2007-09-06 21:51:11 UTC
AAAAAAAAAAH. THIS IS A %&$ยง%$ DEFAULT ENTRY FOR EVERYTHING THAT RUNS AS A DIFFERENT USER AND LOGS, JUST IN CASE.
Just take a look in /etc/logrotate.d/* . mysql, privoxy, elog-save-summary.
Consider it or drop it.
I give up on this one.