Skip to content

Submit patch for safer log rotation by svlogd

Currently runit's svlogd can get stuck in an unbounded retry loop when trying to rename a log file as part of its log rotation procedure. If that log file has been deleted or renamed at any time since creation, svlogd will continue logging to the deleted log file via its open file descriptor and then fail repeatedly when trying to rotate that deleted log file. This can have an unintuitive side effect on the processes writing to that logging pipe -- when the pipe's buffer fills, the application processes can stall in their write syscall, potentially indefinitely. As a safety improvement to avoid this corner case, we can instead skip the file rename if we detect that the old file we wish to rotate has vanished.