Bug 183228 - copytruncate not truncating
copytruncate not truncating
Status: CLOSED DUPLICATE of bug 190468
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: logrotate (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-27 11:50 EST by Chris Stankaitis
Modified: 2015-01-07 19:11 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Chris Stankaitis 2006-02-27 11:50:44 EST
Description of problem:

setup a simple logrotate conf file for a system we need to rotate.

# cat /etc/logrotate.d/billinglog
/fdc/datapull/logs/*.log {
        copytruncate
        compress
}

when the log rotates it seems to do the job, but it never truncates the logfile..

-> Before

-rw-rw-r--    1 vxnpull  vxnpull       17M Feb 27 16:42 instance_1_25647.log
-rw-rw-r--    1 vxnpull  vxnpull       64K Feb 26 04:02 instance_1_25647.log.1.gz
-rw-rw-r--    1 vxnpull  vxnpull       14K Feb 24 19:52 instance_1_25647.log.2.gz
-rw-rw-r--    1 vxnpull  vxnpull       15M Feb 27 16:43 instance_2_25645.log
-rw-rw-r--    1 vxnpull  vxnpull       59K Feb 26 04:02 instance_2_25645.log.1.gz
-rw-rw-r--    1 vxnpull  vxnpull       12K Feb 24 19:52 instance_2_25645.log.2.gz
-rw-rw-r--    1 vxnpull  vxnpull      111M Feb 27 16:43 instance_3_25646.log
-rw-rw-r--    1 vxnpull  vxnpull      333K Feb 26 04:02 instance_3_25646.log.1.gz
-rw-rw-r--    1 vxnpull  vxnpull       83K Feb 24 19:52 instance_3_25646.log.2.gz
-rw-rw-r--    1 vxnpull  vxnpull       21M Feb 27 16:43 instance_4_25649.log
-rw-rw-r--    1 vxnpull  vxnpull       45K Feb 26 04:02 instance_4_25649.log.1.gz
-rw-rw-r--    1 vxnpull  vxnpull       16K Feb 24 19:52 instance_4_25649.log.2.gz


-> after

 logrotate -v /etc/logrotate.d/billinglog
reading config file /etc/logrotate.d/billinglog
reading config info for /fdc/datapull/logs/*.log

Handling 1 logs

rotating pattern: /fdc/datapull/logs/*.log  1048576 bytes (no old logs will be kept)
empty log files are rotated, old logs are removed
considering log /fdc/datapull/logs/instance_1_25647.log
  log needs rotating
considering log /fdc/datapull/logs/instance_2_25645.log
  log needs rotating
considering log /fdc/datapull/logs/instance_3_25646.log
  log needs rotating
considering log /fdc/datapull/logs/instance_4_25649.log
  log needs rotating
rotating log /fdc/datapull/logs/instance_1_25647.log, log->rotateCount is 0
renaming /fdc/datapull/logs/instance_1_25647.log.1.gz to
/fdc/datapull/logs/instance_1_25647.log.2.gz (rotatecount 1, logstart 1, i 1),
renaming /fdc/datapull/logs/instance_1_25647.log.0.gz to
/fdc/datapull/logs/instance_1_25647.log.1.gz (rotatecount 1, logstart 1, i 0),
old log /fdc/datapull/logs/instance_1_25647.log.0.gz does not exist
copying /fdc/datapull/logs/instance_1_25647.log to
/fdc/datapull/logs/instance_1_25647.log.1
truncating /fdc/datapull/logs/instance_1_25647.log
compressing new log with: /bin/gzip  '/fdc/datapull/logs/instance_1_25647.log.1'
removing old log /fdc/datapull/logs/instance_1_25647.log.2.gz
rotating log /fdc/datapull/logs/instance_2_25645.log, log->rotateCount is 0
renaming /fdc/datapull/logs/instance_2_25645.log.1.gz to
/fdc/datapull/logs/instance_2_25645.log.2.gz (rotatecount 1, logstart 1, i 1),
renaming /fdc/datapull/logs/instance_2_25645.log.0.gz to
/fdc/datapull/logs/instance_2_25645.log.1.gz (rotatecount 1, logstart 1, i 0),
old log /fdc/datapull/logs/instance_2_25645.log.0.gz does not exist
copying /fdc/datapull/logs/instance_2_25645.log to
/fdc/datapull/logs/instance_2_25645.log.1
truncating /fdc/datapull/logs/instance_2_25645.log
compressing new log with: /bin/gzip  '/fdc/datapull/logs/instance_2_25645.log.1'
removing old log /fdc/datapull/logs/instance_2_25645.log.2.gz
rotating log /fdc/datapull/logs/instance_3_25646.log, log->rotateCount is 0
renaming /fdc/datapull/logs/instance_3_25646.log.1.gz to
/fdc/datapull/logs/instance_3_25646.log.2.gz (rotatecount 1, logstart 1, i 1),
renaming /fdc/datapull/logs/instance_3_25646.log.0.gz to
/fdc/datapull/logs/instance_3_25646.log.1.gz (rotatecount 1, logstart 1, i 0),
old log /fdc/datapull/logs/instance_3_25646.log.0.gz does not exist
copying /fdc/datapull/logs/instance_3_25646.log to
/fdc/datapull/logs/instance_3_25646.log.1
truncating /fdc/datapull/logs/instance_3_25646.log
compressing new log with: /bin/gzip  '/fdc/datapull/logs/instance_3_25646.log.1'
removing old log /fdc/datapull/logs/instance_3_25646.log.2.gz
rotating log /fdc/datapull/logs/instance_4_25649.log, log->rotateCount is 0
renaming /fdc/datapull/logs/instance_4_25649.log.1.gz to
/fdc/datapull/logs/instance_4_25649.log.2.gz (rotatecount 1, logstart 1, i 1),
renaming /fdc/datapull/logs/instance_4_25649.log.0.gz to
/fdc/datapull/logs/instance_4_25649.log.1.gz (rotatecount 1, logstart 1, i 0),
old log /fdc/datapull/logs/instance_4_25649.log.0.gz does not exist
copying /fdc/datapull/logs/instance_4_25649.log to
/fdc/datapull/logs/instance_4_25649.log.1
truncating /fdc/datapull/logs/instance_4_25649.log
compressing new log with: /bin/gzip  '/fdc/datapull/logs/instance_4_25649.log.1'
removing old log /fdc/datapull/logs/instance_4_25649.log.2.gz



-rw-rw-r--    1 vxnpull  vxnpull  17680178 Feb 27 16:48 instance_1_25647.log
-rw-rw-r--    1 vxnpull  vxnpull     84766 Feb 27 16:48 instance_1_25647.log.1.gz
-rw-rw-r--    1 vxnpull  vxnpull  15610603 Feb 27 16:49 instance_2_25645.log
-rw-rw-r--    1 vxnpull  vxnpull     63924 Feb 27 16:48 instance_2_25645.log.1.gz
-rw-rw-r--    1 vxnpull  vxnpull  116818971 Feb 27 16:49 instance_3_25646.log
-rw-rw-r--    1 vxnpull  vxnpull    389555 Feb 27 16:48 instance_3_25646.log.1.gz
-rw-rw-r--    1 vxnpull  vxnpull         0 Feb 27 16:49 instance_4_25649.log
-rw-rw-r--    1 vxnpull  vxnpull     55062 Feb 27 16:49 instance_4_25649.log.1.gz


Version-Release number of selected component (if applicable):

logrotate-3.6.9-1

How reproducible:

always

  
Actual results:

Log's are rotated and compressed however the main log is never truncated and
continues to grow.

Expected results:

Logs are rotated and the main log is truncated leaving you with a 0 byte file
until new log data is written to the file.

Additional info:
Comment 1 Peter Vrabec 2006-05-03 10:56:29 EDT

*** This bug has been marked as a duplicate of 190468 ***

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