-
Notifications
You must be signed in to change notification settings - Fork 161
K8SPSMDB-1518: allow specifying logrotate configuration #2151
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,18 +4,23 @@ | |
|
|
||
| export PATH="$PATH":/opt/fluent-bit/bin | ||
|
|
||
| LOGROTATE_CONF_DIR="" | ||
| if [ -f /opt/percona/logcollector/logrotate/conf.d ]; then | ||
|
||
| LOGROTATE_CONF_DIR="/opt/percona/logcollector/logrotate/conf.d" | ||
| fi | ||
|
|
||
| if [ "$1" = 'logrotate' ]; then | ||
| if [[ $EUID != 1001 ]]; then | ||
|
Check warning on line 13 in build/logcollector/entrypoint.sh
|
||
| # logrotate requires UID in /etc/passwd | ||
| sed -e "s^x:1001:^x:$EUID:^" /etc/passwd >/tmp/passwd | ||
|
Check warning on line 15 in build/logcollector/entrypoint.sh
|
||
| cat /tmp/passwd >/etc/passwd | ||
| rm -rf /tmp/passwd | ||
| fi | ||
| exec go-cron "0 0 * * *" sh -c "logrotate -s /data/db/logs/logrotate.status /opt/percona/logcollector/logrotate/logrotate.conf;" | ||
| exec go-cron "0 0 * * *" sh -c "logrotate -s /data/db/logs/logrotate.status /opt/percona/logcollector/logrotate/logrotate.conf ${LOGROTATE_CONF_DIR};" | ||
|
||
| else | ||
| if [ "$1" = 'fluent-bit' ]; then | ||
| fluentbit_opt+='-c /opt/percona/logcollector/fluentbit/fluentbit.conf' | ||
|
Check warning on line 22 in build/logcollector/entrypoint.sh
|
||
| fi | ||
|
|
||
| exec "$@" $fluentbit_opt | ||
|
Check notice on line 25 in build/logcollector/entrypoint.sh
|
||
| fi | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
percona-server-mongodb-operator/build/logcollector/entrypoint.sh
Line 25 in cfd50e0