[Twisted-Python] Known bug with twistd log rotation

wp11226852-max max at riehl.io
Wed Jun 11 10:22:27 MDT 2014


Thanks Jean-Paul. I have no idea how I managed to miss both tickets (there is a
duplicate) and would like to apologize.

The required change is really small, despite the age of the ticket. Is there
anything I can do to help fix it (e.G. contribute)?

Thanks a lot for your work on Twisted.

Regards,
max

> exarkun at twistedmatrix.com hat am 11. Juni 2014 um 17:52 geschrieben:
>
>
> On 03:05 pm, max at riehl.io wrote:
> >Hi!
> >
> >I'm finding it difficult to get log rotation working cleanly with
> >twistd (if dropping privileges through twistd, which we require).
> >I went through all the docs and also found [1] very helpful, but the
> >problem boils down to the fact that
> >> Implications for Logfile Rotation
> >>
> >>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.
> >
> >and
> >> def rotate(self):
> >> """
> >> Rotate the file and create a new one.
> >>
> >> If it's not possible to open new logfile, this will fail
> >>silently,
> >> and continue logging to old logfile.
> >> """
> >> if not (os.access(self.directory, os.W_OK) and
> >>os.access(self.path, os.W_OK)):
> >> return
> >(twisted 14.0.0)
> >
> >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.
> >There is a workaround on a comment in [1] but that's a really
> >unnecessary and hacky solution, IMHO.
> >
> >Is this a known bug?
>
> Sounds like https://twistedmatrix.com/trac/ticket/5723
>
> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20140611/ac784e41/attachment.html>


More information about the Twisted-Python mailing list