how do utilities like logrotate work? i'm wondering about the underlying mechanics so that i can be comfortable putting it under a running service
-
-
yeah this is definitely the case. Usually doing something like a lock file then using rename to overwrite the original is a common use case, you need the guaranteed atomicity. I mean the only downside I could see is overwriting the state if two processes work on the same file.
-
Somewhat related: I'd love to see a Rust port of https://github.com/mafintosh/fd-lock … to have access to cross-platform file locking.
- 2 more replies
New conversation -
-
-
aha! that makes sense, the file descriptor wouldn't care that the filename changed as long as it can still write to it that explains why the sample logrotate configuration only has "post-rotate" commands that restart the daemon in question
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.