Bug 190468

Summary: copytruncate not truncating
Product: [Fedora] Fedora Reporter: Mike Tiernan <mtiernan>
Component: logrotateAssignee: Peter Vrabec <pvrabec>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: cstankaitis
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-03 14:55:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test service none

Description Mike Tiernan 2006-05-02 17:50:28 UTC
+++ This bug was initially created as a clone of Bug #183228 +++

Description of problem:

Log files are rotated, copied, and compressed, but seemingly not truncated. All
operations are reported to execute without error, but after logrotate finishes,
the log file is the same size as before it started. If the log file is then
observed in emacs after the copy/truncate, the start of the file is filled with
@ signs. In our case, we only observe the lack of truncation when there is
another process running which may be writing to the log file when logrotate
runs. If logrotate is run on a file which is not open by another process, then
the copy/truncate operation copies, compresses, and truncates the file
successfully. The log files are of size 1MB or more.

Comment 1 Peter Vrabec 2006-05-03 14:48:17 UTC
I think this problem is about how another process handle its log file. Log file has to be 
opened with O_APPEND flag otherwise the sparse file is created after truncation. And 
that seems like there was not any truncation done by logrotate. 
 
see: 
du  --apparent-size --block-size=1 log_file 
du  --block-size=1 log_file 
 

Comment 2 Peter Vrabec 2006-05-03 14:53:10 UTC
Created attachment 128537 [details]
test service

try to compile(with and without O_APPEND flag in open())
run logrotate on log_file while test service is running

Comment 3 Peter Vrabec 2006-05-03 14:56:42 UTC
*** Bug 183228 has been marked as a duplicate of this bug. ***