[Twisted-Python] Log file ownership

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Jun 8 08:57:24 EDT 2012

On 7 Jun, 12:46 am, enriquejr at gmail.com wrote:
>I am running an app as root on Linux using a .tac file and twistd. The
>application object is initialized with a certain gid and uid. Logging 
>configured to rotate daily by way of DailyLogFile. However, the log 
>it creates is owned by root with 600 file permission and log rotation 
>failing. I have read about acl to configure default file permissions 
>is there a way to solve this only in Twisted?

Log rotation - ie, renaming a file - isn't affected by the permissions 
of the log file.  The permissions of the *directory containing the log 
file* control whether it can be renamed (and a new one created) or not.

So it doesn't matter what permissions the log file has.  It only matters 
what permissions you set on the directory holding the log file.  That's 
outside of the control of twistd.


More information about the Twisted-Python mailing list