[Twisted-Python] Log file ownership

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Jun 8 06:57:24 MDT 2012


On 7 Jun, 12:46 am, enriquejr at gmail.com wrote:
>Hi,
>
>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 
>is
>configured to rotate daily by way of DailyLogFile. However, the log 
>file
>it creates is owned by root with 600 file permission and log rotation 
>is
>failing. I have read about acl to configure default file permissions 
>but
>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.

Jean-Paul




More information about the Twisted-Python mailing list