docker-logrotate icon indicating copy to clipboard operation
docker-logrotate copied to clipboard

logrotate has no permit to rotate the log files in /logs

Open lowang-bh opened this issue 1 year ago • 1 comments

error: skipping xxx because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation

lowang-bh avatar Jun 21 '24 09:06 lowang-bh

FYI I just ran into the same issue, and came here to see if anyone else had too (or had a solution). Seems like there could be an easy fix to this project, but in the meantime an init container does the trick:

initContainers:
  - name: init-permissions
    image: busybox:latest
    command: ['sh', '-c', 'chmod 755 /logs']
    volumeMounts:
      - name: whatever
        mountPath: /logs

But perhaps the better suggestion is to use the very similar and more flexible: https://github.com/blacklabelops/logrotate

srstrickland avatar Jul 04 '24 07:07 srstrickland