Skip to content

Commit aec932d

Browse files
committed
systemvm: remove logrotate config for wtmp and btmp
logrotate in systemvms run every day. it exits with failure. ``` root@r-100-VM:~# systemctl status logrotate ● logrotate.service - Rotate log files Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2021-03-23 00:00:01 UTC; 2 days ago Docs: man:logrotate(8) man:logrotate.conf(5) Process: 25001 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=1/FAILURE) Main PID: 25001 (code=exited, status=1/FAILURE) Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable. ``` it is because the logrotate for wtmp and btmp already exist in 4.15 systemvm template. ``` root@r-100-VM:~# cat /etc/logrotate.d/wtmp /var/log/wtmp { missingok monthly create 0664 root utmp minsize 1M rotate 1 } root@r-100-VM:~# cat /etc/logrotate.d/btmp /var/log/btmp { missingok monthly create 0660 root utmp rotate 1 } ``` remove them from /etc/logrotate.conf fixes the issue. ``` root@r-100-VM:~# systemctl status logrotate ● logrotate.service - Rotate log files Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor preset: enabled) Active: inactive (dead) since Thu 2021-03-25 00:00:01 UTC; 9h ago Docs: man:logrotate(8) man:logrotate.conf(5) Process: 28211 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=0/SUCCESS) Main PID: 28211 (code=exited, status=0/SUCCESS) Mar 25 00:00:01 r-100-VM systemd[1]: Starting Rotate log files... Mar 25 00:00:01 r-100-VM systemd[1]: logrotate.service: Succeeded. Mar 25 00:00:01 r-100-VM systemd[1]: Started Rotate log files. ```
1 parent 952b242 commit aec932d

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

systemvm/debian/etc/logrotate.conf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,3 @@ size 50M
1111
compress
1212
# RPM packages drop log rotation information into this directory
1313
include /etc/logrotate.d
14-
# no packages own wtmp and btmp -- we'll rotate them here
15-
/var/log/wtmp {
16-
monthly
17-
create 0664 root utmp
18-
rotate 1
19-
}
20-
/var/log/btmp {
21-
missingok
22-
monthly
23-
create 0600 root utmp
24-
rotate 1
25-
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# no packages own btmp -- we'll rotate it here
2+
/var/log/btmp {
3+
missingok
4+
monthly
5+
create 0660 root utmp
6+
rotate 1
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# no packages own wtmp -- we'll rotate it here
2+
/var/log/wtmp {
3+
missingok
4+
monthly
5+
create 0664 root utmp
6+
minsize 1M
7+
rotate 1
8+
}

0 commit comments

Comments
 (0)