ustcweizhou opened a new pull request #4872: URL: https://github.com/apache/cloudstack/pull/4872
### Description logrotate in systemvms run every day. however 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-17975-VM systemd[1]: Starting Rotate log files... Mar 25 00:00:01 r-17975-VM systemd[1]: logrotate.service: Succeeded. Mar 25 00:00:01 r-17975-VM systemd[1]: Started Rotate log files. ``` ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [X] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [X] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org