Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Logrotate two times via crontab and anacron give a conflict #25

Closed
tgruenert opened this issue Oct 2, 2018 · 3 comments
Closed

Logrotate two times via crontab and anacron give a conflict #25

tgruenert opened this issue Oct 2, 2018 · 3 comments

Comments

@tgruenert
Copy link

Logrotation of /var/log/apache is defined

  1. via crontab (see crontab -e)
  2. via /etc/cond.daily/apache

Theese two systems work in same directory and rotate there file each other. Very confusing. This triggers high load of CPU and in filesystem.

A decision is needed about witch system to use in future.

@jeffballard
Copy link

I might also suggest a third way. The "docker way" is to log to stdout/stderr and let docker handle the logs. https://docs.docker.com/config/containers/logging/

@tiredofit
Copy link
Owner

Hi, just in the middle of moving houses so will look into this in a few days, I'm likely to just purge the contents of the cron.daily/.hourly folders and stick loading cron via the s6 init system. However, in the meantime, you can put in your environment variables ENABLE_CRON=FALSE which will disable the logrotate immediately until I have a fix.

@jeffballard I would love to go the docker route (or better, send it to Logstash), this image has multiple logs (fail2ban, freepbx and asterisk <at least 5> and then apache) which might get pretty unruly quickly. My asterisk/full log is over 3gb in a 24 hour period.

I have someone in my office working on an alternative logging solution that I should see the results of it when back in October 15th, and if it meets our needs I will merge it into this image.

@tiredofit
Copy link
Owner

@tgruenert I have identified the issue. Anacron isn't installed but is being called from the cron.* as identified, so I have cleaned that up. However the more glaring problem was that Logrotate was archiving Apache log files, but then creating archives of those archives creating one big mess and pinning the CPU with compressing the logs. Our logs are huge so this was naturally causing some performance issues. Thanks for the report. There is a new build coming momentarily.

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

No branches or pull requests

3 participants