mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
overlay coreos/config: Add Flatcar modifications for app-admin/logrotate
This commit is contained in:
parent
a6bb791eef
commit
0a031b1396
45
sdk_container/src/third_party/coreos-overlay/coreos/config/env/app-admin/logrotate
vendored
Normal file
45
sdk_container/src/third_party/coreos-overlay/coreos/config/env/app-admin/logrotate
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
cros_post_src_install_logrotate_flatcar_modifications() {
|
||||||
|
insinto /etc
|
||||||
|
newins - logrotate.conf <<'EOF'
|
||||||
|
# keep only the most recent old log.
|
||||||
|
rotate 1
|
||||||
|
|
||||||
|
# create new (empty) log files after rotating old ones.
|
||||||
|
create
|
||||||
|
|
||||||
|
# use date as a suffix of the rotated file.
|
||||||
|
dateext
|
||||||
|
|
||||||
|
# compress rotated log files.
|
||||||
|
compress
|
||||||
|
|
||||||
|
# if a file to rotate is missing, don't log an error.
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
nomail
|
||||||
|
noolddir
|
||||||
|
|
||||||
|
# packages can drop log rotation information into this directory.
|
||||||
|
include /etc/logrotate.d
|
||||||
|
|
||||||
|
# no packages own wtmp and btmp -- we'll rotate them here.
|
||||||
|
# must match creation rules in /usr/lib/tmpfiles.d/var.conf
|
||||||
|
/var/log/wtmp {
|
||||||
|
create 0664 root utmp
|
||||||
|
size 1M
|
||||||
|
}
|
||||||
|
/var/log/btmp {
|
||||||
|
create 0600 root utmp
|
||||||
|
size 1M
|
||||||
|
}
|
||||||
|
|
||||||
|
# system-specific logs may also be configured here.
|
||||||
|
EOF
|
||||||
|
# install this for backward compatibility
|
||||||
|
dosym -r /usr/share/flatcar/etc/logrotate.conf /usr/share/logrotate/logrotate.conf
|
||||||
|
insinto /usr/share/flatcar/etc
|
||||||
|
newins - logrotate.conf
|
||||||
|
|
||||||
|
# needs systemd eclass to be inherited by the ebuild
|
||||||
|
systemd_enable_service multi-user.target logrotate.timer
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user