Bug 190468 - copytruncate not truncating
copytruncate not truncating
Product: Fedora
Classification: Fedora
Component: logrotate (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
: 183228 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2006-05-02 13:50 EDT by Mike Tiernan
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-05-03 10:55:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Mike Tiernan 2006-05-02 13:50:28 EDT
+++ 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 10:48:17 EDT
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. 
du  --apparent-size --block-size=1 log_file 
du  --block-size=1 log_file 
Comment 2 Peter Vrabec 2006-05-03 10:53:10 EDT
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 10:56:42 EDT
*** 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.