Bug 190468 - copytruncate not truncating
Summary: copytruncate not truncating
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: 5
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact:
URL:
Whiteboard:
: 183228 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-02 17:50 UTC by Mike Tiernan
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-05-03 14:55:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test service (391 bytes, text/plain)
2006-05-03 14:53 UTC, Peter Vrabec
no flags Details

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. ***


Note You need to log in before you can comment on or make changes to this bug.