app-admin/logrotate: Apply Flatcar modifications

This commit is contained in:
Aniruddha Basak 2021-10-28 16:03:42 +00:00
parent 49bcee9ae7
commit 770a3a48d4
4 changed files with 14 additions and 20 deletions

View File

@ -1,13 +1,5 @@
# # keep only the most recent old log.
# Default logrotate(8) configuration file for Gentoo Linux. rotate 1
# See "man logrotate" for details.
# rotate log files weekly.
weekly
#daily
# keep 4 weeks worth of backlogs.
rotate 4
# create new (empty) log files after rotating old ones. # create new (empty) log files after rotating old ones.
create create
@ -18,25 +10,20 @@ dateext
# compress rotated log files. # compress rotated log files.
compress compress
missingok
notifempty notifempty
nomail nomail
noolddir noolddir
# packages can drop log rotation information into this directory. # accept user provided configuration files in /etc.
include /etc/logrotate.d 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 { /var/log/wtmp {
monthly
create 0664 root utmp create 0664 root utmp
minsize 1M size 1M
rotate 1
} }
/var/log/btmp { /var/log/btmp {
missingok
monthly
create 0600 root utmp create 0600 root utmp
rotate 1 size 1M
} }
# system-specific logs may also be configured here.

View File

@ -0,0 +1,5 @@
[Unit]
Description=Rotate and Compress System Logs
[Service]
ExecStart=/usr/sbin/logrotate /usr/share/logrotate/logrotate.conf

View File

@ -1 +1,2 @@
d /var/lib/misc d /var/lib/misc
d /etc/logrotate.d - - - - -

View File

@ -70,6 +70,7 @@ src_install() {
use cron && install_cron_file use cron && install_cron_file
systemd_dounit examples/logrotate.{service,timer} systemd_dounit examples/logrotate.{service,timer}
systemd_enable_service multi-user.target logrotate.timer
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
keepdir /etc/logrotate.d keepdir /etc/logrotate.d