Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce cron logging level by default and allow environment override #1012

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

kenstir
Copy link

@kenstir kenstir commented Feb 22, 2025

Description:

  • Reduce cron logging level by default and allow environment override

Benefits of this PR and context:

Before this change, a linuxserver/qbittorrent:latest container run in Synology Container Manager would log multiple lines every minute. This made it hard to track down interesting and useful log messages.

Before:

2025-02-22T17:41:00.403267015Z crond[143]: wakeup dt=60
2025-02-22T17:41:00.403730420Z crond[143]: file root:
2025-02-22T17:41:00.403768954Z crond[143]:  line run-parts /etc/periodic/15min
2025-02-22T17:41:00.403805925Z crond[143]:  line run-parts /etc/periodic/hourly
2025-02-22T17:41:00.403838763Z crond[143]:  line run-parts /etc/periodic/daily
2025-02-22T17:41:00.403867506Z crond[143]:  line run-parts /etc/periodic/weekly
2025-02-22T17:41:00.403896633Z crond[143]:  line run-parts /etc/periodic/monthly
2025-02-22T17:42:00.403677263Z crond[143]: wakeup dt=60
2025-02-22T17:42:00.404104919Z crond[143]: file root:
2025-02-22T17:42:00.404149538Z crond[143]:  line run-parts /etc/periodic/15min
2025-02-22T17:42:00.404184588Z crond[143]:  line run-parts /etc/periodic/hourly
2025-02-22T17:42:00.404217121Z crond[143]:  line run-parts /etc/periodic/daily
2025-02-22T17:42:00.404250163Z crond[143]:  line run-parts /etc/periodic/weekly
2025-02-22T17:42:00.404283776Z crond[143]:  line run-parts /etc/periodic/monthly

After:

2025-02-22T18:00:00.164428156Z crond[177]: USER root pid 248 cmd run-parts /etc/periodic/15min
2025-02-22T18:00:00.165065698Z crond[177]: USER root pid 249 cmd run-parts /etc/periodic/hourly

How Has This Been Tested?

  • Built this mod and pushed it to docker hub
  • Restarted the container with env DOCKER_MODS=docker.io/kenstir/alpine-quieter-cron:latest
  • Observed quieter logs
2025-02-22T17:46:56.485663276Z [mod-init] Adding kenstir/alpine-quieter-cron:latest to container
2025-02-22T17:46:56.839723354Z [mod-init] Downloading kenstir/alpine-quieter-cron:latest from registry-1.docker.io
2025-02-22T17:46:57.034326995Z [mod-init] Installing kenstir/alpine-quieter-cron:latest
2025-02-22T17:46:57.046603271Z [mod-init] kenstir/alpine-quieter-cron:latest applied to container
...
2025-02-22T17:46:58.179792352Z [ls.io-init] done.
2025-02-22T18:00:00.164428156Z crond[177]: USER root pid 248 cmd run-parts /etc/periodic/15min
2025-02-22T18:00:00.165065698Z crond[177]: USER root pid 249 cmd run-parts /etc/periodic/hourly
2025-02-22T18:15:00.167862812Z crond[177]: USER root pid 255 cmd run-parts /etc/periodic/15min

aptalca and others added 30 commits February 2, 2020 15:55
switch to callable mod builder
add issue-pr tracker workflow
update permissions script
update readme instructions
aptalca and others added 6 commits August 22, 2024 11:37
template: fix casing to suppress docker build warning
Make cron logging configurable and quieter:
* Support env var CRON_LOG_LEVEL, which is passed to the crond
  implementation
* Default to being quieter and briefly explain rationale
@kenstir kenstir force-pushed the alpine-quieter-cron branch from 693a590 to 9a15dcc Compare February 23, 2025 02:31
@kenstir
Copy link
Author

kenstir commented Feb 23, 2025

Sorry, I forgot to ask the team: If you agree with the rationale for this PR, then please create a branch universal-quieter-cron and I will retarget the PR.

@LinuxServer-CI
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

7 participants