Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

logrotate config files will be overwritten every hour #2773

Closed
niusmallnan opened this issue May 16, 2019 · 1 comment
Closed

logrotate config files will be overwritten every hour #2773

niusmallnan opened this issue May 16, 2019 · 1 comment

Comments

@niusmallnan
Copy link
Contributor

RancherOS Version: (ros os version)
v1.5.1
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)
All

The logrotate service runs every hour by cron service, you can check its service label.
https://github.com/rancher/os/blob/master/os-config.tpl.yml#L249-L256

    logrotate:
      image: {{.OS_REPO}}/os-logrotate:{{.VERSION}}{{.SUFFIX}}
      command: /usr/sbin/logrotate -v /etc/logrotate.conf
      labels:
        io.rancher.os.createonly: "true"
        io.rancher.os.scope: system
        io.rancher.os.before: system-cron
        cron.schedule: "@hourly"

The logrotate has en entrypoint script, https://github.com/rancher/os/blob/master/images/02-logrotate/usr/bin/entrypoint.sh:

#!/bin/bash

cp /usr/share/logrotate/logrotate.d/* /etc/logrotate.d

exec /usr/bin/ros entrypoint "$@"

If the /etc/logrotate.d/docker file is modified, it will be overwritten each time, as the /usr/share/logrotate/logrotate.d/docker file is in the logrotate container.

@rootwuj
Copy link

rootwuj commented May 27, 2019

Tested with rancher/os:v1.5.2-rc1 from May 27
This version of logrotate config files will not be overwritten every hour.
Verified fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants