Bug 38143

Summary: logrotate does not trigger UMC components to reopen their logfiles - 60_umc.08_logrotate.test fails
Product: UCS Test Reporter: Philipp Hahn <hahn>
Component: UMCAssignee: Philipp Hahn <hahn>
Status: CLOSED FIXED QA Contact: Florian Best <best>
Severity: normal    
Priority: P5 CC: best, ebersbach, klaeser, salm, schwardt, walkenhorst
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
What kind of report is it?: --- What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional): Error handling, External feedback, Troubleshooting
Max CVSS v3 score:
Bug Depends on: 36473, 37159, 37316, 37317, 38563    
Bug Blocks:    
Attachments: Fix 60_umc.08_logrotate.test

Description Philipp Hahn univentionstaff 2015-03-27 12:49:03 CET
Created attachment 6787 [details]
Fix 60_umc.08_logrotate.test

60_umc.08_logrotate.test fails from time to time:
<http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-1/job/Autotest%20MultiEnv/SambaVersion=s4,Systemrolle=master/50/testReport/junit/60_umc/08_logrotate/test/>

On my S4-Master-test-VM:
1st run succeeded
2nd run failed
3rd run failed

Is is caused by
# grep -n notifempty /etc/logrotate.d/univention-management-console 
17:     notifempty
28:     notifempty

As the server has not yet printed any output, logrotate finds an empty files and skips the rotation. Thus the server re-opens the same file again.

Even after doing the following, the test still fails:
# sed -i -e '/notifempty/d' /etc/logrotate.d/univention-management-console

As signal processing happens asynchronously, that is the signaling process continues running before the signaled process had a chance to re-open its file. Thus the test fails from time to time without the attached patch, which does:
1. add more debugging
2. Use os.path.samestat()
3. Remove several @property as they might change from use to use.
4. Can probably run on all system roles only the UMC servers are required
5. Call logrotate only once

+++ This bug was initially created as a clone of Bug #37317 +++
Comment 1 Philipp Hahn univentionstaff 2015-03-27 12:58:27 CET
r59471 | Bug #38143 test: Fix 60_umc.08_logrotate.test
Comment 2 Philipp Hahn univentionstaff 2015-03-31 09:07:48 CEST
Failed once more: <http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-1/job/Autotest%20MultiEnv/SambaVersion=s3,Systemrolle=member/54/testReport/junit/60_umc/08_logrotate/test/>

r59505 | Bug #38143 test: Fix 60_umc.08_logrotate.test

Package: ucs-test
Version: 5.0.140-9.1013.201503310856
Branch: ucs_4.0-0
Scope: errata4.0-1
Comment 3 Florian Best univentionstaff 2015-05-04 18:28:51 CEST
Ok, looks good.