<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi!<br>
<br>
I'm finding it difficult to get log rotation working cleanly with
twistd (if dropping privileges through twistd, which we require).<br>
I went through all the docs and also found [1] very helpful, but the
problem boils down to the fact that<br>
<br>
<br>
<blockquote type="cite">
<h2>Implications for Logfile Rotation</h2>
<p>Using the configuration described here, the LOGFILE will be
created as user “root” and group “root”, but rotated as user UID
and group GID. If you want rotation to work as advertised it is
necessary to put the LOGFILE in a directory in which UID/GID has
permissions to rename files.</p>
</blockquote>
<br>
and<br>
<br>
<blockquote type="cite"> def rotate(self):<br>
"""<br>
Rotate the file and create a new one.<br>
<br>
If it's not possible to open new logfile, this will fail
silently,<br>
and continue logging to old logfile.<br>
"""<br>
if not (os.access(self.directory, os.W_OK) and
os.access(self.path, os.W_OK)):<br>
return</blockquote>
(twisted 14.0.0)<br>
<br>
will never work together. Even if the user twistd runs as is
technically able to rename the log file (due to having write
permissions on the directory), it will never try to since it can't
write to the file.<br>
There is a workaround on a comment in [1] but that's a really
unnecessary and hacky solution, IMHO.<br>
<br>
Is this a known bug?<br>
I remember running into this issue a year ago or so and IIRC I just
gave up.<br>
<br>
<br>
Thanks for any pointers,<br>
max<br>
<br>
[1]<br>
<a class="moz-txt-link-freetext" href="http://www.tsheffler.com/blog/?p=526">http://www.tsheffler.com/blog/?p=526</a><br>
</body>
</html>