Preston-Landers / concurrent-log-handler

fork of ConcurrentLogHandler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConcurrentRotatingFileHandler chmod will fail across many users

blakehilliard opened this issue · comments

Suppose I have a script which can by run by many users, which uses ConcurrentRotatingFileHandler to the same log file. You've provide "chmod" to allow us to set permissions to ensure it is made writable by both users, but there are 2 problems:

  1. Even if the file is made writable, "chmod" is not allowed by another process (on linux at least?). So if root creates the file and the script chmods it to open up the permissions, then if some other user runs the script, their "chmod" with throw an exception.
  2. A small race condition on file creation, where there log is created and then afterward the permissions are changed.